From 9b3351bcb2fe525e505d97f50613c4336b46b81d Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 13 Feb 2018 14:10:43 +0000 Subject: [PATCH] vstart: mgr/dashboard_v2 enabling and configuration Signed-off-by: Ricardo Dias --- src/vstart.sh | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/vstart.sh b/src/vstart.sh index 6324469453a33..fc7228ba0a020 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -136,6 +136,7 @@ VSTART_SEC="client.vstart.sh" MON_ADDR="" DASH_URLS="" +DASH_V2_URLS="" RESTFUL_URLS="" conf_fn="$CEPH_CONF_PATH/ceph.conf" @@ -684,15 +685,24 @@ EOF else DASH_URLS+=", http://$IP:$MGR_PORT" fi - MGR_PORT=$(($MGR_PORT + 1000)) + MGR_PORT=$(($MGR_PORT + 1000)) - ceph_adm config-key set mgr/restful/$name/server_port $MGR_PORT + ceph_adm config-key set mgr/restful/$name/server_port $MGR_PORT if [ $mgr -eq 1 ]; then RESTFUL_URLS="https://$IP:$MGR_PORT" else RESTFUL_URLS+=", https://$IP:$MGR_PORT" fi - MGR_PORT=$(($MGR_PORT + 1000)) + MGR_PORT=$(($MGR_PORT + 1000)) + + # dashboard_v2 + ceph_adm config-key set mgr/dashboard_v2/$name/server_port $MGR_PORT + if [ $mgr -eq 1 ]; then + DASH_V2_URLS="http://$IP:$MGR_PORT" + else + DASH_V2_URLS+=", http://$IP:$MGR_PORT" + fi + MGR_PORT=$(($MGR_PORT + 1000)) echo "Starting mgr.${name}" run 'mgr' $CEPH_BIN/ceph-mgr -i $name $ARGS @@ -708,6 +718,16 @@ EOF else echo MGR Restful is not working, perhaps the package is not installed? fi + + # dashboard_v2 + # build frontend + pushd $MGR_PYTHON_PATH/dashboard_v2/frontend + npm install + npm run build + popd + # setting login credentials for dashboard_v2 + ceph_adm mgr module enable dashboard_v2 + ceph_adm tell mgr dashboard set-login-credentials admin admin } start_mds() { @@ -1061,6 +1081,9 @@ echo "dashboard urls: $DASH_URLS" echo " restful urls: $RESTFUL_URLS" echo " w/ user/pass: admin / $RESTFUL_SECRET" echo "" +echo "dashboard_v2 urls: $DASH_V2_URLS" +echo " w/ user/pass: admin / admin" +echo "" echo "export PYTHONPATH=./pybind:$PYTHONPATH" echo "export LD_LIBRARY_PATH=$CEPH_LIB" -- 2.39.5