]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart: mgr/dashboard_v2 enabling and configuration
authorRicardo Dias <rdias@suse.com>
Tue, 13 Feb 2018 14:10:43 +0000 (14:10 +0000)
committerRicardo Dias <rdias@suse.com>
Mon, 5 Mar 2018 13:07:14 +0000 (13:07 +0000)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/vstart.sh

index 6324469453a33deb9414e15eeea60b95b351ce24..fc7228ba0a0205f66bca08d8343054341a7961eb 100755 (executable)
@@ -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"