]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/vstart.sh
update sources to v12.1.1
[ceph.git] / ceph / src / vstart.sh
index f796a3c721a8e71bf7c626c66c582f1f5ba023d4..5f698227d19daca5a254febf40e6fc4798fee82b 100755 (executable)
@@ -108,6 +108,7 @@ cache=""
 memstore=0
 bluestore=0
 rgw_frontend="civetweb"
+rgw_compression=""
 lockdep=${LOCKDEP:-1}
 
 filestore_path=
@@ -148,6 +149,7 @@ usage=$usage"\t--rgw_num specify ceph rgw count\n"
 usage=$usage"\t--mgr_num specify ceph mgr count\n"
 usage=$usage"\t--rgw_port specify ceph rgw http listen port\n"
 usage=$usage"\t--rgw_frontend specify the rgw frontend configuration\n"
+usage=$usage"\t--rgw_compression specify the rgw compression plugin\n"
 usage=$usage"\t-b, --bluestore use bluestore as the osd objectstore backend\n"
 usage=$usage"\t--memstore use memstore as the osd objectstore backend\n"
 usage=$usage"\t--cache <pool>: enable cache tiering on pool\n"
@@ -257,6 +259,10 @@ case $1 in
             rgw_frontend=$2
             shift
             ;;
+    --rgw_compression )
+            rgw_compression=$2
+            shift
+            ;;
     --filestore_path )
        filestore_path=$2
        shift
@@ -409,10 +415,9 @@ prepare_conf() {
         mon data avail crit = 1
         erasure code dir = $EC_PATH
         plugin dir = $CEPH_LIB
-        osd pool default erasure code profile = plugin=jerasure technique=reed_sol_van k=2 m=1 ruleset-failure-domain=osd
+        osd pool default erasure code profile = plugin=jerasure technique=reed_sol_van k=2 m=1 crush-failure-domain=osd
         rgw frontends = $rgw_frontend port=$CEPH_RGW_PORT
         ; needed for s3tests
-        rgw enable static website = 1
         rgw crypt s3 kms encryption keys = testkey-1=YmluCmJvb3N0CmJvb3N0LWJ1aWxkCmNlcGguY29uZgo= testkey-2=aWIKTWFrZWZpbGUKbWFuCm91dApzcmMKVGVzdGluZwo=
         rgw crypt require ssl = false
         rgw lc debug interval = 10
@@ -448,6 +453,8 @@ EOF
         log file = $CEPH_OUT_DIR/\$name.\$pid.log
         admin socket = $CEPH_OUT_DIR/\$name.\$pid.asok
 
+[client.rgw]
+
 [mds]
 $DAEMONOPTS
 $CMDSDEBUG
@@ -459,7 +466,6 @@ $CMDSDEBUG
         mds root ino gid = `id -g`
 $extra_conf
 [mgr]
-        mgr modules = restful fsstatus dashboard
         mgr data = $CEPH_DEV_DIR/mgr.\$id
         mgr module path = $MGR_PYTHON_PATH
         mon reweight min pgs per osd = 4
@@ -498,9 +504,9 @@ $COSDMEMSTORE
 $COSDSHORT
 $extra_conf
 [mon]
+        mgr initial modules = restful status dashboard
         mon pg warn min per osd = 3
         mon osd allow primary affinity = true
-        mon osd allow pg upmap = true
         mon reweight min pgs per osd = 4
         mon osd prime pg temp = true
         crushtool = $CEPH_BIN/crushtool
@@ -547,6 +553,12 @@ start_mon() {
                        --cap mgr 'allow *' \
                        "$keyring_fn"
 
+               prun $SUDO "$CEPH_BIN/ceph-authtool" --gen-key --name=client.rgw \
+                   --cap mon 'allow rw' \
+                   --cap osd 'allow rwx' \
+                   --cap mgr 'allow rw' \
+                   "$keyring_fn"
+
                # build a fresh fs monmap, mon fs
                local str=""
                local count=0
@@ -634,12 +646,10 @@ start_mgr() {
         host = $HOSTNAME
 EOF
 
-       ceph_adm config-key put mgr/dashboard/$name/server_addr $IP
        ceph_adm config-key put mgr/dashboard/$name/server_port $MGR_PORT
        DASH_URLS+="http://$IP:$MGR_PORT/"
        MGR_PORT=$(($MGR_PORT + 1000))
 
-       ceph_adm config-key put mgr/restful/$name/server_addr $IP
        ceph_adm config-key put mgr/restful/$name/server_port $MGR_PORT
 
        RESTFUL_URLS+="https://$IP:$MGR_PORT"
@@ -649,11 +659,14 @@ EOF
         run 'mgr' $CEPH_BIN/ceph-mgr -i $name $ARGS
     done
 
-    SF=`mktemp`
-    ceph_adm tell mgr restful create-self-signed-cert
-    ceph_adm tell mgr restful create-key admin -o $SF
-    RESTFUL_SECRET=`cat $SF`
-    rm $SF
+    if ceph_adm tell mgr restful create-self-signed-cert; then
+        SF=`mktemp`
+        ceph_adm tell mgr restful create-key admin -o $SF
+        RESTFUL_SECRET=`cat $SF`
+        rm $SF
+    else 
+        echo MGR Restful is not working, perhaps the package is not installed?
+    fi
 }
 
 start_mds() {
@@ -917,7 +930,7 @@ EOF
 }
 do_hitsets $hitset
 
-do_rgw()
+do_rgw_create_users()
 {
     # Create S3 user
     local akey='0555b35654ad1656d804'
@@ -962,9 +975,18 @@ do_rgw()
     echo "  user      : tester"
     echo "  password  : testing"
     echo ""
+}
 
+do_rgw()
+{
+    if [ "$new" -eq 1 ]; then
+       do_rgw_create_users
+        if [ -n "$rgw_compression" ]; then
+            echo "setting compression type=$rgw_compression"
+            $CEPH_BIN/radosgw-admin zone placement modify -c $conf_fn --rgw-zone=default --placement-id=default-placement --compression=$rgw_compression > /dev/null
+        fi
+    fi
     # Start server
-    echo start rgw on http://localhost:$CEPH_RGW_PORT
     RGWDEBUG=""
     if [ "$debug" -ne 0 ]; then
         RGWDEBUG="--debug-rgw=20"
@@ -973,8 +995,12 @@ do_rgw()
     RGWSUDO=
     [ $CEPH_RGW_PORT -lt 1024 ] && RGWSUDO=sudo
     n=$(($CEPH_NUM_RGW - 1))
-    for rgw in `seq 0 $n`; do
-       run 'rgw' $RGWSUDO $CEPH_BIN/radosgw -c $conf_fn --log-file=${CEPH_OUT_DIR}/rgw.$rgw.log ${RGWDEBUG} --debug-ms=1
+    i=0
+    for rgw in j k l m n o p q r s t u v; do
+       echo start rgw on http://localhost:$((CEPH_RGW_PORT + i))
+       run 'rgw' $RGWSUDO $CEPH_BIN/radosgw -c $conf_fn --log-file=${CEPH_OUT_DIR}/rgw.$rgw.log ${RGWDEBUG} --debug-ms=1 -n client.rgw "--rgw_frontends=${rgw_frontend} port=$((CEPH_RGW_PORT + i))"
+       i=$(($i + 1))
+        [ $i -eq $CEPH_NUM_RGW ] && break
     done
 }
 if [ "$CEPH_NUM_RGW" -gt 0 ]; then