]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cstart.sh: some improvements 40390/head
authorSage Weil <sage@newdream.net>
Wed, 24 Mar 2021 21:58:52 +0000 (17:58 -0400)
committerSage Weil <sage@newdream.net>
Wed, 24 Mar 2021 21:58:52 +0000 (17:58 -0400)
- keep using the same port over multiple incantations (like we do the fsid)
- fix the image inspect line to work with (sudo) podman
- pass args on to cephadm bootstrap
- disable use_repo_digest so that we don't do a pull from
  cephadm's convert_tags_to_repo_digest

Signed-off-by: Sage Weil <sage@newdream.net>
src/cstart.sh

index 71f4200a43d7d1205bcfcc09ca5a2b8baccdec0a..ca76c789ca3b1a4c9fe9dbdd2089c62dcb333332 100755 (executable)
@@ -18,6 +18,7 @@ fi
 echo "fsid $fsid"
 
 shortid=`echo $fsid | cut -c 1-8`
+echo $shortid > shortid
 echo "shortid $shortid"
 
 # ip
@@ -35,17 +36,21 @@ fi
 echo "ip $ip"
 
 # port
-if [ -z "$port" ]; then
+if [ -e port ] ; then
+    port=`cat port`
+else
     while [ true ]
     do
         port="$(echo $(( RANDOM % 1000 + 40000 )))"
-        ss -a -n | grep LISTEN | grep "${ip}:${port} " 1>/dev/null 2>&1 || break
+        ss -a -n | grep LISTEN | grep "${ip}:${port} " 2>&1 >/dev/null || break
     done
+    echo $port > port
 fi
-echo "port $port"
+echo "mon port $port"
+
 
 # make sure we have an image
-if ! $runtime image inspect $image_base:$shortid 2>/dev/null; then
+if ! sudo $runtime image inspect $image_base:$shortid 1>/dev/null 2>/dev/null; then
     echo "building initial $image_base:$shortid image..."
     sudo ../src/script/cpatch -t $image_base:$shortid
 fi
@@ -56,12 +61,16 @@ sudo ../src/cephadm/cephadm --image ${image_base}:${shortid} bootstrap \
      --fsid $fsid \
      --mon-addrv "[v2:$ip:$port]" \
      --output-dir . \
-     --allow-overwrite
+     --allow-overwrite \
+     $@
 
 # kludge to make 'bin/ceph ...' work
 sudo chmod 755 ceph.client.admin.keyring
 echo 'keyring = ceph.client.admin.keyring' >> ceph.conf
 
+# don't use repo digests; this implicitly does a pull and we don't want that
+bin/ceph config set mgr mgr/cephadm/use_repo_digest false
+
 echo
 echo "sudo ../src/script/cpatch -t $image_base:$shortid"
 echo