2 # -*- mode:sh; tab-width:4; sh-basic-offset:4; indent-tabs-mode:nil -*-
3 # vim: softtabstop=4 shiftwidth=4 expandtab
10 if [[ "$s" =~ \
]]; then
11 printf -- "'%s' " "$s"
24 debug quoted_print
"$@" '&'
29 debug quoted_print
"$@"
34 if [ -n "$VSTART_DEST" ]; then
36 SRC_PATH
=`(cd $SRC_PATH; pwd)`
42 CEPH_CONF_PATH
=$VSTART_DEST
43 CEPH_DEV_DIR
=$VSTART_DEST/dev
44 CEPH_OUT_DIR
=$VSTART_DEST/out
45 CEPH_ASOK_DIR
=$VSTART_DEST/out
48 get_cmake_variable
() {
50 grep "${variable}:" CMakeCache.txt | cut
-d "=" -f 2
53 # for running out of the CMake build directory
54 if [ -e CMakeCache.txt
]; then
55 # Out of tree build, learn source location from CMakeCache.txt
56 CEPH_ROOT
=$
(get_cmake_variable ceph_SOURCE_DIR
)
58 [ -z "$MGR_PYTHON_PATH" ] && MGR_PYTHON_PATH
=$CEPH_ROOT/src
/pybind
/mgr
61 # use CEPH_BUILD_ROOT to vstart from a 'make install'
62 if [ -n "$CEPH_BUILD_ROOT" ]; then
63 [ -z "$CEPH_BIN" ] && CEPH_BIN
=$CEPH_BUILD_ROOT/bin
64 [ -z "$CEPH_LIB" ] && CEPH_LIB
=$CEPH_BUILD_ROOT/lib
65 [ -z "$CEPH_EXT_LIB" ] && CEPH_EXT_LIB
=$CEPH_BUILD_ROOT/external
/lib
66 [ -z "$EC_PATH" ] && EC_PATH
=$CEPH_LIB/erasure-code
67 [ -z "$OBJCLASS_PATH" ] && OBJCLASS_PATH
=$CEPH_LIB/rados-classes
68 # make install should install python extensions into PYTHONPATH
69 elif [ -n "$CEPH_ROOT" ]; then
70 [ -z "$CEPHFS_SHELL" ] && CEPHFS_SHELL
=$CEPH_ROOT/src
/tools
/cephfs
/cephfs-shell
71 [ -z "$PYBIND" ] && PYBIND
=$CEPH_ROOT/src
/pybind
72 [ -z "$CEPH_BIN" ] && CEPH_BIN
=$CEPH_BUILD_DIR/bin
73 [ -z "$CEPH_ADM" ] && CEPH_ADM
=$CEPH_BIN/ceph
74 [ -z "$INIT_CEPH" ] && INIT_CEPH
=$CEPH_BIN/init-ceph
75 [ -z "$CEPH_LIB" ] && CEPH_LIB
=$CEPH_BUILD_DIR/lib
76 [ -z "$CEPH_EXT_LIB" ] && CEPH_EXT_LIB
=$CEPH_BUILD_DIR/external
/lib
77 [ -z "$OBJCLASS_PATH" ] && OBJCLASS_PATH
=$CEPH_LIB
78 [ -z "$EC_PATH" ] && EC_PATH
=$CEPH_LIB
79 [ -z "$CEPH_PYTHON_COMMON" ] && CEPH_PYTHON_COMMON
=$CEPH_ROOT/src
/python-common
82 if [ -z "${CEPH_VSTART_WRAPPER}" ]; then
86 [ -z "$PYBIND" ] && PYBIND
=.
/pybind
88 [ -n "$CEPH_PYTHON_COMMON" ] && CEPH_PYTHON_COMMON
="$CEPH_PYTHON_COMMON:"
89 CYTHON_PYTHONPATH
="$CEPH_LIB/cython_modules/lib.3"
90 export PYTHONPATH
=$PYBIND:$CYTHON_PYTHONPATH:$CEPH_PYTHON_COMMON$PYTHONPATH
92 export LD_LIBRARY_PATH
=$CEPH_LIB:$CEPH_EXT_LIB:$LD_LIBRARY_PATH
93 export DYLD_LIBRARY_PATH
=$CEPH_LIB:$CEPH_EXT_LIB:$DYLD_LIBRARY_PATH
94 # Suppress logging for regular use that indicated that we are using a
95 # development version. vstart.sh is only used during testing and
99 [ -z "$CEPH_NUM_MON" ] && CEPH_NUM_MON
="$MON"
100 [ -z "$CEPH_NUM_OSD" ] && CEPH_NUM_OSD
="$OSD"
101 [ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS
="$MDS"
102 [ -z "$CEPH_NUM_MGR" ] && CEPH_NUM_MGR
="$MGR"
103 [ -z "$CEPH_NUM_FS" ] && CEPH_NUM_FS
="$FS"
104 [ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW
="$RGW"
105 [ -z "$GANESHA_DAEMON_NUM" ] && GANESHA_DAEMON_NUM
="$NFS"
107 # if none of the CEPH_NUM_* number is specified, kill the existing
109 if [ -z "$CEPH_NUM_MON" -a \
110 -z "$CEPH_NUM_OSD" -a \
111 -z "$CEPH_NUM_MDS" -a \
112 -z "$CEPH_NUM_MGR" -a \
113 -z "$GANESHA_DAEMON_NUM" ]; then
119 [ -z "$CEPH_NUM_MON" ] && CEPH_NUM_MON
=3
120 [ -z "$CEPH_NUM_OSD" ] && CEPH_NUM_OSD
=3
121 [ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS
=3
122 [ -z "$CEPH_NUM_MGR" ] && CEPH_NUM_MGR
=1
123 [ -z "$CEPH_NUM_FS" ] && CEPH_NUM_FS
=1
124 [ -z "$CEPH_MAX_MDS" ] && CEPH_MAX_MDS
=1
125 [ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW
=0
126 [ -z "$GANESHA_DAEMON_NUM" ] && GANESHA_DAEMON_NUM
=0
128 [ -z "$CEPH_DIR" ] && CEPH_DIR
="$PWD"
129 [ -z "$CEPH_DEV_DIR" ] && CEPH_DEV_DIR
="$CEPH_DIR/dev"
130 [ -z "$CEPH_OUT_DIR" ] && CEPH_OUT_DIR
="$CEPH_DIR/out"
131 [ -z "$CEPH_RGW_PORT" ] && CEPH_RGW_PORT
=8000
132 [ -z "$CEPH_CONF_PATH" ] && CEPH_CONF_PATH
=$CEPH_DIR
134 if [ $CEPH_NUM_OSD -gt 3 ]; then
135 OSD_POOL_DEFAULT_SIZE
=3
137 OSD_POOL_DEFAULT_SIZE
=$CEPH_NUM_OSD
154 cephx
=1 #turn cephx on by default
157 if [ `uname` = FreeBSD
]; then
158 objectstore
="filestore"
160 objectstore
="bluestore"
165 lockdep
=${LOCKDEP:-1}
166 spdk_enabled
=0 #disable SPDK by default
171 with_mgr_dashboard
=true
172 if [[ "$(get_cmake_variable WITH_MGR_DASHBOARD_FRONTEND)" != "ON" ]] ||
173 [[ "$(get_cmake_variable WITH_RBD)" != "ON" ]]; then
174 debug
echo "ceph-mgr dashboard not built - disabling."
175 with_mgr_dashboard
=false
182 VSTART_SEC
="client.vstart.sh"
188 conf_fn
="$CEPH_CONF_PATH/ceph.conf"
189 keyring_fn
="$CEPH_CONF_PATH/keyring"
190 osdmap_fn
="/tmp/ceph_osdmap.$$"
191 monmap_fn
="/tmp/ceph_monmap.$$"
196 usage
="usage: $0 [option]... \nex: MON=3 OSD=1 MDS=1 MGR=1 RGW=1 NFS=1 $0 -n -d\n"
197 usage
=$usage"options:\n"
198 usage
=$usage"\t-d, --debug\n"
199 usage
=$usage"\t-s, --standby_mds: Generate standby-replay MDS for each active\n"
200 usage
=$usage"\t-l, --localhost: use localhost instead of hostname\n"
201 usage
=$usage"\t-i <ip>: bind to specific ip\n"
202 usage
=$usage"\t-n, --new\n"
203 usage
=$usage"\t--valgrind[_{osd,mds,mon,rgw}] 'toolname args...'\n"
204 usage
=$usage"\t--nodaemon: use ceph-run as wrapper for mon/osd/mds\n"
205 usage
=$usage"\t--redirect-output: only useful with nodaemon, directs output to log file\n"
206 usage
=$usage"\t--smallmds: limit mds cache memory limit\n"
207 usage
=$usage"\t-m ip:port\t\tspecify monitor address\n"
208 usage
=$usage"\t-k keep old configuration files (default)\n"
209 usage
=$usage"\t-x enable cephx (on by default)\n"
210 usage
=$usage"\t-X disable cephx\n"
211 usage
=$usage"\t-g --gssapi enable Kerberos/GSSApi authentication\n"
212 usage
=$usage"\t-G disable Kerberos/GSSApi authentication\n"
213 usage
=$usage"\t--hitset <pool> <hit_set_type>: enable hitset tracking\n"
214 usage
=$usage"\t-e : create an erasure pool\n";
215 usage
=$usage"\t-o config\t\t add extra config parameters to all sections\n"
216 usage
=$usage"\t--rgw_port specify ceph rgw http listen port\n"
217 usage
=$usage"\t--rgw_frontend specify the rgw frontend configuration\n"
218 usage
=$usage"\t--rgw_compression specify the rgw compression plugin\n"
219 usage
=$usage"\t-b, --bluestore use bluestore as the osd objectstore backend (default)\n"
220 usage
=$usage"\t-f, --filestore use filestore as the osd objectstore backend\n"
221 usage
=$usage"\t-K, --kstore use kstore as the osd objectstore backend\n"
222 usage
=$usage"\t--memstore use memstore as the osd objectstore backend\n"
223 usage
=$usage"\t--cache <pool>: enable cache tiering on pool\n"
224 usage
=$usage"\t--short: short object names only; necessary for ext4 dev\n"
225 usage
=$usage"\t--nolockdep disable lockdep\n"
226 usage
=$usage"\t--multimds <count> allow multimds with maximum active count\n"
227 usage
=$usage"\t--without-dashboard: do not run using mgr dashboard\n"
228 usage
=$usage"\t--bluestore-spdk: enable SPDK and with a comma-delimited list of PCI-IDs of NVME device (e.g, 0000:81:00.0)\n"
229 usage
=$usage"\t--msgr1: use msgr1 only\n"
230 usage
=$usage"\t--msgr2: use msgr2 only\n"
231 usage
=$usage"\t--msgr21: use msgr2 and msgr1\n"
232 usage
=$usage"\t--crimson: use crimson-osd instead of ceph-osd\n"
233 usage
=$usage"\t--osd-args: specify any extra osd specific options\n"
234 usage
=$usage"\t--bluestore-devs: comma-separated list of blockdevs to use for bluestore\n"
235 usage
=$usage"\t--bluestore-zoned: blockdevs listed by --bluestore-devs are zoned devices (HM-SMR HDD or ZNS SSD)\n"
236 usage
=$usage"\t--bluestore-io-uring: enable io_uring backend\n"
237 usage
=$usage"\t--inc-osd: append some more osds into existing vcluster\n"
238 usage
=$usage"\t--cephadm: enable cephadm orchestrator with ~/.ssh/id_rsa[.pub]\n"
239 usage
=$usage"\t--no-parallel: dont start all OSDs in parallel\n"
240 usage
=$usage"\t--jaeger: use jaegertracing for tracing\n"
247 while [ $# -ge 1 ]; do
259 [ -z "$2" ] && usage_exit
273 if [ "$inc_osd_num" == "" ]; then
305 [ -z "$2" ] && usage_exit
314 [ -z "$2" ] && usage_exit
319 [ -z "$2" ] && usage_exit
324 [ -z "$2" ] && usage_exit
329 [ -z "$2" ] && usage_exit
334 [ -z "$2" ] && usage_exit
368 [ -z "$2" ] && usage_exit
373 cephx
=1 # this is on be default, flag exists for historical consistency
387 if [ ! -r $conf_fn ]; then
388 echo "cannot use old configuration: $conf_fn not readable." >&2
394 objectstore
="memstore"
397 objectstore
="bluestore"
400 objectstore
="filestore"
406 hitset
="$hitset $2 $3"
411 extra_conf
+=$
'\n'"$2"
415 if [ -z "$cache" ]; then
430 with_mgr_dashboard
=false
433 [ -z "$2" ] && usage_exit
434 IFS
=',' read -r -a bluestore_spdk_dev
<<< "$2"
439 IFS
=',' read -r -a bluestore_dev
<<< "$2"
440 for dev
in "${bluestore_dev[@]}"; do
441 if [ ! -b $dev -o ! -w $dev ]; then
442 echo "All --bluestore-devs must refer to writable block devices"
451 --bluestore-io-uring)
457 echo "with_jaeger $with_jaeger"
465 if [ $kill_all -eq 1 ]; then
466 $SUDO $INIT_CEPH stop
469 if [ "$new" -eq 0 ]; then
470 if [ -z "$CEPH_ASOK_DIR" ]; then
471 CEPH_ASOK_DIR
=`dirname $($CEPH_BIN/ceph-conf -c $conf_fn --show-config-value admin_socket)`
473 mkdir
-p $CEPH_ASOK_DIR
474 MON
=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC --lookup num_mon 2>/dev/null` && \
476 OSD
=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC --lookup num_osd 2>/dev/null` && \
478 MDS
=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC --lookup num_mds 2>/dev/null` && \
480 MGR
=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC --lookup num_mgr 2>/dev/null` && \
482 RGW
=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC --lookup num_rgw 2>/dev/null` && \
484 NFS
=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC --lookup num_ganesha 2>/dev/null` && \
485 GANESHA_DAEMON_NUM
="$NFS"
488 if [ -e "$conf_fn" ]; then
489 asok_dir
=`dirname $($CEPH_BIN/ceph-conf -c $conf_fn --show-config-value admin_socket)`
491 if [ $asok_dir != /var
/run
/ceph
]; then
492 [ -d $asok_dir ] && rm -f $asok_dir/* && rmdir $asok_dir
495 if [ -z "$CEPH_ASOK_DIR" ]; then
496 CEPH_ASOK_DIR
=`mktemp -u -d "${TMPDIR:-/tmp}/ceph-asok.XXXXXX"`
507 eval "valg=\$valgrind_$type"
508 [ -z "$valg" ] && valg
="$valgrind"
510 if [ -n "$valg" ]; then
511 prunb valgrind
--tool="$valg" $valgrind_args "$@" -f
514 if [ "$nodaemon" -eq 0 ]; then
516 elif [ "$redirect" -eq 0 ]; then
517 prunb
${CEPH_ROOT}/src
/ceph-run
"$@" -f
519 ( prunb
${CEPH_ROOT}/src
/ceph-run
"$@" -f ) >$CEPH_OUT_DIR/$type.
$num.stdout
2>&1
525 if [ "$new" -eq 1 -o "$overwrite_conf" -eq 1 ]; then
533 if [ $CEPH_NUM_RGW -eq 0 ]; then
537 # setup each rgw on a sequential port, starting at $CEPH_RGW_PORT.
538 # individual rgw's ids will be their ports.
539 current_port
=$CEPH_RGW_PORT
540 for n
in $
(seq 1 $CEPH_NUM_RGW); do
542 [client.rgw.${current_port}]
543 rgw frontends = $rgw_frontend port=${current_port}
544 admin socket = ${CEPH_OUT_DIR}/radosgw.${current_port}.asok
546 current_port
=$
((current_port
+ 1))
556 while read -r opt
; do
557 if [ -z "$formatted" ]; then
560 formatted
+=$
'\n'${indent}${opt}
568 log file = $CEPH_OUT_DIR/\$name.log
569 admin socket = $CEPH_ASOK_DIR/\$name.asok
571 pid file = $CEPH_OUT_DIR/\$name.pid
572 heartbeat file = $CEPH_OUT_DIR/\$name.heartbeat
575 local mgr_modules
="restful iostat nfs"
576 if $with_mgr_dashboard; then
577 mgr_modules
="dashboard $mgr_modules"
581 if [ $msgr -eq 21 ]; then
582 msgr_conf
="ms bind msgr2 = true
583 ms bind msgr1 = true"
585 if [ $msgr -eq 2 ]; then
586 msgr_conf
="ms bind msgr2 = true
587 ms bind msgr1 = false"
589 if [ $msgr -eq 1 ]; then
590 msgr_conf
="ms bind msgr2 = false
591 ms bind msgr1 = true"
595 ; generated by vstart.sh on `date`
597 num mon = $CEPH_NUM_MON
598 num osd = $CEPH_NUM_OSD
599 num mds = $CEPH_NUM_MDS
600 num mgr = $CEPH_NUM_MGR
601 num rgw = $CEPH_NUM_RGW
602 num ganesha = $GANESHA_DAEMON_NUM
606 osd failsafe full ratio = .99
607 mon osd full ratio = .99
608 mon osd nearfull ratio = .99
609 mon osd backfillfull ratio = .99
610 mon_max_pg_per_osd = ${MON_MAX_PG_PER_OSD:-1000}
611 erasure code dir = $EC_PATH
612 plugin dir = $CEPH_LIB
613 filestore fd cache size = 32
614 run dir = $CEPH_OUT_DIR
615 crash dir = $CEPH_OUT_DIR
616 enable experimental unrecoverable data corrupting features = *
617 osd_crush_chooseleaf_type = 0
618 debug asok assert abort = true
619 $(format_conf "${msgr_conf}")
620 $(format_conf "${extra_conf}")
622 if [ "$lockdep" -eq 1 ] ; then
627 if [ "$cephx" -eq 1 ] ; then
629 auth cluster required = cephx
630 auth service required = cephx
631 auth client required = cephx
633 elif [ "$gssapi_authx" -eq 1 ] ; then
635 auth cluster required = gss
636 auth service required = gss
637 auth client required = gss
638 gss ktab client file = $CEPH_DEV_DIR/gss_\$name.keytab
642 auth cluster required = none
643 auth service required = none
644 auth client required = none
647 if [ "$short" -eq 1 ]; then
648 COSDSHORT
=" osd max object name len = 460
649 osd max object namespace len = 64"
651 if [ "$objectstore" == "bluestore" ]; then
652 if [ "$spdk_enabled" -eq 1 ]; then
653 BLUESTORE_OPTS
=" bluestore_block_db_path = \"\"
654 bluestore_block_db_size = 0
655 bluestore_block_db_create = false
656 bluestore_block_wal_path = \"\"
657 bluestore_block_wal_size = 0
658 bluestore_block_wal_create = false
659 bluestore_spdk_mem = 2048"
661 BLUESTORE_OPTS
=" bluestore block db path = $CEPH_DEV_DIR/osd\$id/block.db.file
662 bluestore block db size = 1073741824
663 bluestore block db create = true
664 bluestore block wal path = $CEPH_DEV_DIR/osd\$id/block.wal.file
665 bluestore block wal size = 1048576000
666 bluestore block wal create = true"
668 if [ "$zoned_enabled" -eq 1 ]; then
670 bluestore min alloc size = 65536
671 bluestore prefer deferred size = 0
672 bluestore prefer deferred size hdd = 0
673 bluestore prefer deferred size ssd = 0
674 bluestore allocator = zoned"
676 if [ "$io_uring_enabled" -eq 1 ]; then
683 keyring = $keyring_fn
684 log file = $CEPH_OUT_DIR/\$name.\$pid.log
685 admin socket = $CEPH_ASOK_DIR/\$name.\$pid.asok
688 rgw crypt s3 kms backend = testing
689 rgw crypt s3 kms encryption keys = testkey-1=YmluCmJvb3N0CmJvb3N0LWJ1aWxkCmNlcGguY29uZgo= testkey-2=aWIKTWFrZWZpbGUKbWFuCm91dApzcmMKVGVzdGluZwo=
690 rgw crypt require ssl = false
691 ; uncomment the following to set LC days as the value in seconds;
692 ; needed for passing lc time based s3-tests (can be verbose)
693 ; rgw lc debug interval = 10
694 $(format_conf "${extra_conf}")
700 mds data = $CEPH_DEV_DIR/mds.\$id
701 mds root ino uid = `id -u`
702 mds root ino gid = `id -g`
703 $(format_conf "${extra_conf}")
705 mgr data = $CEPH_DEV_DIR/mgr.\$id
706 mgr module path = $MGR_PYTHON_PATH
707 cephadm path = $CEPH_ROOT/src/cephadm/cephadm
709 $(format_conf "${extra_conf}")
712 osd_check_max_object_name_len_on_startup = false
713 osd data = $CEPH_DEV_DIR/osd\$id
714 osd journal = $CEPH_DEV_DIR/osd\$id/journal
715 osd journal size = 100
717 osd class dir = $OBJCLASS_PATH
718 osd class load list = *
719 osd class default list = *
720 osd fast shutdown = false
722 filestore wbthrottle xfs ios start flusher = 10
723 filestore wbthrottle xfs ios hard limit = 20
724 filestore wbthrottle xfs inodes hard limit = 30
725 filestore wbthrottle btrfs ios start flusher = 10
726 filestore wbthrottle btrfs ios hard limit = 20
727 filestore wbthrottle btrfs inodes hard limit = 30
728 bluestore fsck on mount = true
729 bluestore block create = true
733 kstore fsck on mount = true
734 osd objectstore = $objectstore
736 $(format_conf "${extra_conf}")
738 mgr initial modules = $mgr_modules
741 $(format_conf "${extra_conf}")
742 mon cluster log file = $CEPH_OUT_DIR/cluster.mon.\$id.log
743 osd pool default erasure code profile = plugin=jerasure technique=reed_sol_van k=2 m=1 crush-failure-domain=osd
744 auth allow insecure global id reclaim = false
748 write_logrotate_conf
() {
749 out_dir
=$
(pwd)"/out/*.log"
762 # NOTE: assuring that the absence of one of the following processes
763 # won't abort the logrotate command.
764 killall -u $USER -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw rbd-mirror || echo ""
771 logrotate_conf_path
=$
(pwd)"/logrotate.conf"
772 logrotate_state_path
=$
(pwd)"/logrotate.state"
774 if ! test -a $logrotate_conf_path; then
775 if test -a $logrotate_state_path; then
776 rm -f $logrotate_state_path
778 write_logrotate_conf
> $logrotate_conf_path
785 for f
in a b c d e f g h i j k l m n o p q r s t u v w x y z
787 [ $count -eq $CEPH_NUM_MON ] && break;
788 count
=$
(($count + 1))
789 if [ -z "$MONS" ]; then
796 if [ "$new" -eq 1 ]; then
797 if [ `echo $IP | grep '^127\\.'` ]; then
799 echo "NOTE: hostname resolves to loopback; remote hosts will not be able to"
800 echo " connect. either adjust /etc/hosts, or edit this script to use your"
801 echo " machine's real IP."
805 prun
$SUDO "$CEPH_BIN/ceph-authtool" --create-keyring --gen-key --name=mon.
"$keyring_fn" --cap mon
'allow *'
806 prun
$SUDO "$CEPH_BIN/ceph-authtool" --gen-key --name=client.admin \
807 --cap mon
'allow *' \
808 --cap osd
'allow *' \
809 --cap mds
'allow *' \
810 --cap mgr
'allow *' \
813 # build a fresh fs monmap, mon fs
819 if [ $msgr -eq 1 ]; then
820 A
="v1:$IP:$(($CEPH_PORT+$count+1))"
822 if [ $msgr -eq 2 ]; then
823 A
="v2:$IP:$(($CEPH_PORT+$count+1))"
825 if [ $msgr -eq 21 ]; then
826 A
="[v2:$IP:$(($CEPH_PORT+$count)),v1:$IP:$(($CEPH_PORT+$count+1))]"
828 params
+=("--addv" "$f" "$A")
829 mon_host
="$mon_host $A"
833 mon data = $CEPH_DEV_DIR/mon.$f
835 count
=$
(($count + 2))
841 prun
"$CEPH_BIN/monmaptool" --create --clobber "${params[@]}" --print "$monmap_fn"
845 prun
rm -rf -- "$CEPH_DEV_DIR/mon.$f"
846 prun mkdir
-p "$CEPH_DEV_DIR/mon.$f"
847 prun
"$CEPH_BIN/ceph-mon" --mkfs -c "$conf_fn" -i "$f" --monmap="$monmap_fn" --keyring="$keyring_fn"
850 prun
rm -- "$monmap_fn"
856 run
'mon' $f $CEPH_BIN/ceph-mon
-i $f $ARGS $CMON_ARGS
861 if [ $inc_osd_num -gt 0 ]; then
862 old_maxosd
=$
($CEPH_BIN/ceph osd getmaxosd |
sed -e 's/max_osd = //' -e 's/ in epoch.*//')
864 end
=$
(($start-1+$inc_osd_num))
865 overwrite_conf
=1 # fake wconf
868 end
=$
(($CEPH_NUM_OSD-1))
871 for osd
in `seq $start $end`
873 local extra_seastar_args
874 if [ "$ceph_osd" == "crimson-osd" ]; then
875 # designate a single CPU node $osd for osd.$osd
876 extra_seastar_args
="--smp 1 --cpuset $osd"
877 if [ "$debug" -ne 0 ]; then
878 extra_seastar_args
+=" --debug"
881 if [ "$new" -eq 1 -o $inc_osd_num -gt 0 ]; then
886 if [ "$spdk_enabled" -eq 1 ]; then
888 bluestore_block_path = spdk:${bluestore_spdk_dev[$osd]}
892 rm -rf $CEPH_DEV_DIR/osd
$osd || true
893 if command -v btrfs
> /dev
/null
; then
894 for f
in $CEPH_DEV_DIR/osd
$osd/*; do btrfs sub delete
$f &> /dev
/null || true
; done
896 if [ -n "$filestore_path" ]; then
897 ln -s $filestore_path $CEPH_DEV_DIR/osd
$osd
898 elif [ -n "$kstore_path" ]; then
899 ln -s $kstore_path $CEPH_DEV_DIR/osd
$osd
901 mkdir
-p $CEPH_DEV_DIR/osd
$osd
902 if [ -n "${bluestore_dev[$osd]}" ]; then
903 dd if=/dev
/zero of
=${bluestore_dev[$osd]} bs
=1M count
=1
904 ln -s ${bluestore_dev[$osd]} $CEPH_DEV_DIR/osd
$osd/block
906 bluestore fsck on mount = false
912 echo "add osd$osd $uuid"
913 OSD_SECRET
=$
($CEPH_BIN/ceph-authtool
--gen-print-key)
914 echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > $CEPH_DEV_DIR/osd
$osd/new.json
915 ceph_adm osd new
$uuid -i $CEPH_DEV_DIR/osd
$osd/new.json
916 rm $CEPH_DEV_DIR/osd
$osd/new.json
917 $SUDO $CEPH_BIN/$ceph_osd $extra_osd_args -i $osd $ARGS --mkfs --key $OSD_SECRET --osd-uuid $uuid $extra_seastar_args
919 local key_fn
=$CEPH_DEV_DIR/osd
$osd/keyring
927 run
'osd' $osd $SUDO $CEPH_BIN/$ceph_osd \
928 $extra_seastar_args $extra_osd_args \
929 -i $osd $ARGS $COSD_ARGS &
938 for p
in $osds_wait; do
941 debug
echo OSDs started
943 if [ $inc_osd_num -gt 0 ]; then
945 new_maxosd
=$
($CEPH_BIN/ceph osd getmaxosd |
sed -e 's/max_osd = //' -e 's/ in epoch.*//')
946 sed -i "s/num osd = .*/num osd = $new_maxosd/g" $conf_fn
952 local ssl
=${DASHBOARD_SSL:-1}
953 # avoid monitors on nearby ports (which test/*.sh use extensively)
954 MGR_PORT
=$
(($CEPH_PORT + 1000))
956 for name
in x y z a b c d e f g h i j k l m n o p
958 [ $mgr -eq $CEPH_NUM_MGR ] && break
960 if [ "$new" -eq 1 ]; then
961 mkdir
-p $CEPH_DEV_DIR/mgr.
$name
962 key_fn
=$CEPH_DEV_DIR/mgr.
$name/keyring
963 $SUDO $CEPH_BIN/ceph-authtool
--create-keyring --gen-key --name=mgr.
$name $key_fn
964 ceph_adm
-i $key_fn auth add mgr.
$name mon
'allow profile mgr' mds
'allow *' osd
'allow *'
971 if $with_mgr_dashboard ; then
972 local port_option
="ssl_server_port"
973 local http_proto
="https"
974 if [ "$ssl" == "0" ]; then
975 port_option
="server_port"
977 ceph_adm config
set mgr mgr
/dashboard
/ssl false
--force
979 ceph_adm config
set mgr mgr
/dashboard
/$name/$port_option $MGR_PORT --force
980 if [ $mgr -eq 1 ]; then
981 DASH_URLS
="$http_proto://$IP:$MGR_PORT"
983 DASH_URLS
+=", $http_proto://$IP:$MGR_PORT"
986 MGR_PORT
=$
(($MGR_PORT + 1000))
987 ceph_adm config
set mgr mgr
/prometheus
/$name/server_port
$PROMETHEUS_PORT --force
988 PROMETHEUS_PORT
=$
(($PROMETHEUS_PORT + 1000))
990 ceph_adm config
set mgr mgr
/restful
/$name/server_port
$MGR_PORT --force
991 if [ $mgr -eq 1 ]; then
992 RESTFUL_URLS
="https://$IP:$MGR_PORT"
994 RESTFUL_URLS
+=", https://$IP:$MGR_PORT"
996 MGR_PORT
=$
(($MGR_PORT + 1000))
999 debug
echo "Starting mgr.${name}"
1000 run
'mgr' $name $CEPH_BIN/ceph-mgr
-i $name $ARGS
1003 if [ "$new" -eq 1 ]; then
1004 # setting login credentials for dashboard
1005 if $with_mgr_dashboard; then
1006 while ! ceph_adm
-h |
grep -c -q ^dashboard
; do
1007 debug
echo 'waiting for mgr dashboard module to start'
1010 DASHBOARD_ADMIN_SECRET_FILE
="${CEPH_CONF_PATH}/dashboard-admin-secret.txt"
1011 printf 'admin' > "${DASHBOARD_ADMIN_SECRET_FILE}"
1012 ceph_adm dashboard ac-user-create admin
-i "${DASHBOARD_ADMIN_SECRET_FILE}" \
1013 administrator
--force-password
1014 if [ "$ssl" != "0" ]; then
1015 if ! ceph_adm dashboard create-self-signed-cert
; then
1016 debug
echo dashboard module not working correctly
!
1021 while ! ceph_adm
-h |
grep -c -q ^restful
; do
1022 debug
echo 'waiting for mgr restful module to start'
1025 if ceph_adm restful create-self-signed-cert
; then
1027 ceph_adm restful create-key admin
-o $SF
1028 RESTFUL_SECRET
=`cat $SF`
1031 debug
echo MGR Restful is not working
, perhaps the package is not installed?
1035 if [ "$cephadm" -eq 1 ]; then
1036 debug
echo Enabling cephadm orchestrator
1037 if [ "$new" -eq 1 ]; then
1039 https
://registry.hub.docker.com
/v
2/repositories
/ceph
/daemon-base
/tags
/latest-master-devel \
1040 | jq
-r '.images[0].digest')
1041 ceph_adm config
set global container_image
"docker.io/ceph/daemon-base@$digest"
1043 ceph_adm config-key
set mgr
/cephadm
/ssh_identity_key
-i ~
/.ssh
/id_rsa
1044 ceph_adm config-key
set mgr
/cephadm
/ssh_identity_pub
-i ~
/.ssh
/id_rsa.pub
1045 ceph_adm mgr module
enable cephadm
1046 ceph_adm orch
set backend cephadm
1047 ceph_adm orch
host add
"$(hostname)"
1048 ceph_adm orch apply crash
'*'
1049 ceph_adm config
set mgr mgr
/cephadm
/allow_ptrace true
1055 for name
in a b c d e f g h i j k l m n o p
1057 [ $mds -eq $CEPH_NUM_MDS ] && break
1060 if [ "$new" -eq 1 ]; then
1061 prun mkdir
-p "$CEPH_DEV_DIR/mds.$name"
1062 key_fn
=$CEPH_DEV_DIR/mds.
$name/keyring
1067 if [ "$standby" -eq 1 ]; then
1068 mkdir
-p $CEPH_DEV_DIR/mds.
${name}s
1070 mds standby for rank = $mds
1072 mds standby replay = true
1073 mds standby for name = ${name}
1076 prun
$SUDO "$CEPH_BIN/ceph-authtool" --create-keyring --gen-key --name="mds.$name" "$key_fn"
1077 ceph_adm
-i "$key_fn" auth add
"mds.$name" mon
'allow profile mds' osd
'allow rw tag cephfs *=*' mds
'allow' mgr
'allow profile mds'
1078 if [ "$standby" -eq 1 ]; then
1079 prun
$SUDO "$CEPH_BIN/ceph-authtool" --create-keyring --gen-key --name="mds.${name}s" \
1080 "$CEPH_DEV_DIR/mds.${name}s/keyring"
1081 ceph_adm
-i "$CEPH_DEV_DIR/mds.${name}s/keyring" auth add
"mds.${name}s" \
1082 mon
'allow profile mds' osd
'allow *' mds
'allow' mgr
'allow profile mds'
1086 run
'mds' $name $CEPH_BIN/ceph-mds
-i $name $ARGS $CMDS_ARGS
1087 if [ "$standby" -eq 1 ]; then
1088 run
'mds' $name $CEPH_BIN/ceph-mds
-i ${name}s
$ARGS $CMDS_ARGS
1091 #valgrind --tool=massif $CEPH_BIN/ceph-mds $ARGS --mds_log_max_segments 2 --mds_thrash_fragments 0 --mds_thrash_exports 0 > m #--debug_ms 20
1092 #$CEPH_BIN/ceph-mds -d $ARGS --mds_thrash_fragments 0 --mds_thrash_exports 0 #--debug_ms 20
1093 #ceph_adm mds set max_mds 2
1096 if [ $new -eq 1 ]; then
1097 if [ "$CEPH_NUM_FS" -gt "0" ] ; then
1098 sleep 5 # time for MDS to come up as standby to avoid health warnings on fs creation
1099 if [ "$CEPH_NUM_FS" -gt "1" ] ; then
1100 ceph_adm fs flag
set enable_multiple true
--yes-i-really-mean-it
1103 # wait for volume module to load
1104 while ! ceph_adm fs volume
ls ; do sleep 1 ; done
1106 for name
in a b c d e f g h i j k l m n o p
1108 ceph_adm fs volume create
${name}
1109 ceph_adm fs authorize
${name} "client.fs_${name}" / rwp
>> "$keyring_fn"
1111 [ $fs -eq $CEPH_NUM_FS ] && break
1118 # Ganesha Daemons requires nfs-ganesha nfs-ganesha-ceph nfs-ganesha-rados-grace
1119 # nfs-ganesha-rados-urls (version 3.3 and above) packages installed. On
1120 # Fedora>=31 these packages can be installed directly with 'dnf'. For CentOS>=8
1121 # the packages are available at
1122 # https://wiki.centos.org/SpecialInterestGroup/Storage
1123 # Similarly for Ubuntu>=16.04 follow the instructions on
1124 # https://launchpad.net/~nfs-ganesha
1128 GANESHA_PORT
=$
(($CEPH_PORT + 4000))
1130 test_user
="$cluster_id"
1132 namespace
=$cluster_id
1133 url
="rados://$pool_name/$namespace/conf-nfs.$test_user"
1135 prun ceph_adm auth get-or-create client.
$test_user \
1137 osd
"allow rw pool=$pool_name namespace=$namespace, allow rw tag cephfs data=a" \
1138 mds
"allow rw path=/" \
1141 ceph_adm mgr module
enable test_orchestrator
1142 ceph_adm orch
set backend test_orchestrator
1143 ceph_adm test_orchestrator load_data
-i $CEPH_ROOT/src
/pybind
/mgr
/test_orchestrator
/dummy_data.json
1144 prun ceph_adm nfs cluster create
$cluster_id
1145 prun ceph_adm nfs
export create cephfs
--fsname "a" --cluster-id $cluster_id --pseudo-path "/cephfs"
1147 for name
in a b c d e f g h i j k l m n o p
1149 [ $ganesha -eq $GANESHA_DAEMON_NUM ] && break
1151 port
=$
(($GANESHA_PORT + ganesha
))
1152 ganesha
=$
(($ganesha + 1))
1153 ganesha_dir
="$CEPH_DEV_DIR/ganesha.$name"
1154 prun
rm -rf $ganesha_dir
1155 prun mkdir
-p $ganesha_dir
1157 echo "NFS_CORE_PARAM {
1159 Enable_RQUOTA = false;
1169 RecoveryBackend = rados_cluster;
1170 Minor_Versions = 1, 2;
1174 pool = '$pool_name';
1175 namespace = $namespace;
1176 UserId = $test_user;
1181 Userid = $test_user;
1185 %url $url" > "$ganesha_dir/ganesha-$name.conf"
1191 ganesha data = $ganesha_dir
1192 pid file = $CEPH_OUT_DIR/ganesha-$name.pid
1195 prun env CEPH_CONF
="${conf_fn}" ganesha-rados-grace
--userid $test_user -p $pool_name -n $namespace add
$name
1196 prun env CEPH_CONF
="${conf_fn}" ganesha-rados-grace
--userid $test_user -p $pool_name -n $namespace
1198 prun env CEPH_CONF
="${conf_fn}" ganesha.nfsd
-L "$CEPH_OUT_DIR/ganesha-$name.log" -f "$ganesha_dir/ganesha-$name.conf" -p "$CEPH_OUT_DIR/ganesha-$name.pid" -N NIV_DEBUG
1200 # Wait few seconds for grace period to be removed
1203 prun env CEPH_CONF
="${conf_fn}" ganesha-rados-grace
--userid $test_user -p $pool_name -n $namespace
1205 echo "$test_user ganesha daemon $name started on port: $port"
1209 if [ "$debug" -eq 0 ]; then
1214 debug
echo "** going verbose **"
1223 if [ -n "$MON_ADDR" ]; then
1224 CMON_ARGS
=" -m "$MON_ADDR
1225 COSD_ARGS
=" -m "$MON_ADDR
1226 CMDS_ARGS
=" -m "$MON_ADDR
1229 if [ -z "$CEPH_PORT" ]; then
1232 CEPH_PORT
="$(echo $(( RANDOM % 1000 + 40000 )))"
1233 ss
-a -n |
egrep "\<LISTEN\>.+:${CEPH_PORT}\s+" 1>/dev
/null
2>&1 ||
break
1237 [ -z "$INIT_CEPH" ] && INIT_CEPH
=$CEPH_BIN/init-ceph
1240 [ -d $CEPH_DEV_DIR/osd
0/.
] && [ -e $CEPH_DEV_DIR/sudo
] && SUDO
="sudo"
1242 if [ $inc_osd_num -eq 0 ]; then
1243 prun
$SUDO rm -f core
*
1246 [ -d $CEPH_ASOK_DIR ] || mkdir
-p $CEPH_ASOK_DIR
1247 [ -d $CEPH_OUT_DIR ] || mkdir
-p $CEPH_OUT_DIR
1248 [ -d $CEPH_DEV_DIR ] || mkdir
-p $CEPH_DEV_DIR
1249 if [ $inc_osd_num -eq 0 ]; then
1250 $SUDO find "$CEPH_OUT_DIR" -type f
-delete
1252 [ -d gmon
] && $SUDO rm -rf gmon
/*
1254 [ "$cephx" -eq 1 ] && [ "$new" -eq 1 ] && [ -e $keyring_fn ] && rm $keyring_fn
1257 # figure machine's ip
1258 HOSTNAME
=`hostname -s`
1259 if [ -n "$ip" ]; then
1262 echo hostname
$HOSTNAME
1263 if [ -x "$(which ip 2>/dev/null)" ]; then
1268 # filter out IPv4 and localhost addresses
1269 IP
="$($IP_CMD | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | head -n1)"
1270 # if nothing left, try using localhost address, it might work
1271 if [ -z "$IP" ]; then IP
="127.0.0.1"; fi
1274 echo "port $CEPH_PORT"
1277 [ -z $CEPH_ADM ] && CEPH_ADM
=$CEPH_BIN/ceph
1280 if [ "$cephx" -eq 1 ]; then
1281 prun
$SUDO "$CEPH_ADM" -c "$conf_fn" -k "$keyring_fn" "$@"
1283 prun
$SUDO "$CEPH_ADM" -c "$conf_fn" "$@"
1287 if [ $inc_osd_num -gt 0 ]; then
1292 if [ "$new" -eq 1 ]; then
1296 if [ $CEPH_NUM_MON -gt 0 ]; then
1299 debug
echo Populating config ...
1300 cat <<EOF | $CEPH_BIN/ceph -c $conf_fn config assimilate-conf -i -
1302 osd_pool_default_size = $OSD_POOL_DEFAULT_SIZE
1303 osd_pool_default_min_size = 1
1306 mon_osd_reporter_subtree_level = osd
1307 mon_data_avail_warn = 2
1308 mon_data_avail_crit = 1
1309 mon_allow_pool_delete = true
1310 mon_allow_pool_size_one = true
1313 osd_scrub_load_threshold = 2000
1314 osd_debug_op_order = true
1315 osd_debug_misdirected_ops = true
1316 osd_copyfrom_max_chunk = 524288
1319 mds_debug_frag = true
1320 mds_debug_auth_pins = true
1321 mds_debug_subtrees = true
1324 mgr/telemetry/nag = false
1325 mgr/telemetry/enable = false
1329 if [ "$debug" -ne 0 ]; then
1330 debug
echo Setting debug configs ...
1331 cat <<EOF | $CEPH_BIN/ceph -c $conf_fn config assimilate-conf -i -
1345 debug_filestore = 20
1346 debug_bluestore = 20
1358 mds_debug_scatterstat = true
1359 mds_verify_scatter = true
1362 if [ "$cephadm" -gt 0 ]; then
1363 debug
echo Setting mon public_network ...
1364 public_network
=$
(ip route list |
grep -w "$IP" |
awk '{print $1}')
1365 ceph_adm config
set mon public_network
$public_network
1369 if [ $CEPH_NUM_MGR -gt 0 ]; then
1374 if [ $CEPH_NUM_OSD -gt 0 ]; then
1379 if [ "$smallmds" -eq 1 ]; then
1382 mds log max segments = 2
1383 # Default 'mds cache memory limit' is 1GiB, and here we set it to 100MiB.
1384 mds cache memory limit = 100M
1388 if [ $CEPH_NUM_MDS -gt 0 ]; then
1390 # key with access to all FS
1391 ceph_adm fs authorize \
* "client.fs" / rwp
>> "$keyring_fn"
1394 # Don't set max_mds until all the daemons are started, otherwise
1395 # the intended standbys might end up in active roles.
1396 if [ "$CEPH_MAX_MDS" -gt 1 ]; then
1397 sleep 5 # wait for daemons to make it into FSMap before increasing max_mds
1400 for name
in a b c d e f g h i j k l m n o p
1402 [ $fs -eq $CEPH_NUM_FS ] && break
1404 if [ "$CEPH_MAX_MDS" -gt 1 ]; then
1405 ceph_adm fs
set "${name}" max_mds
"$CEPH_MAX_MDS"
1411 if [ "$ec" -eq 1 ]; then
1413 osd erasure-code-profile set ec-profile m=2 k=2
1414 osd pool create ec erasure ec-profile
1419 while [ -n "$*" ]; do
1422 debug
echo "creating cache for pool $p ..."
1424 osd pool create ${p}-cache
1425 osd tier add $p ${p}-cache
1426 osd tier cache-mode ${p}-cache writeback
1427 osd tier set-overlay $p ${p}-cache
1434 while [ -n "$*" ]; do
1439 debug
echo "setting hit_set on pool $pool type $type ..."
1441 osd pool set $pool hit_set_type $type
1442 osd pool set $pool hit_set_count 8
1443 osd pool set $pool hit_set_period 30
1449 do_rgw_create_bucket
()
1452 local rgw_python_file
='rgw-create-bucket.py'
1454 import boto.s3.connection
1456 conn = boto.connect_s3(
1457 aws_access_key_id = '$s3_akey',
1458 aws_secret_access_key = '$s3_skey',
1462 calling_format = boto.s3.connection.OrdinaryCallingFormat(),
1465 bucket = conn.create_bucket('nfs-bucket')
1466 print('created new bucket')" > "$CEPH_OUT_DIR/$rgw_python_file"
1467 prun python
$CEPH_OUT_DIR/$rgw_python_file
1470 do_rgw_create_users
()
1473 s3_akey
='0555b35654ad1656d804'
1474 s3_skey
='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
1475 debug
echo "setting up user testid"
1476 $CEPH_BIN/radosgw-admin user create
--uid testid
--access-key $s3_akey --secret $s3_skey --display-name 'M. Tester' --email tester@ceph.com
-c $conf_fn > /dev
/null
1478 # Create S3-test users
1479 # See: https://github.com/ceph/s3-tests
1480 debug
echo "setting up s3-test users"
1481 $CEPH_BIN/radosgw-admin user create \
1482 --uid 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
1483 --access-key ABCDEFGHIJKLMNOPQRST \
1484 --secret abcdefghijklmnopqrstuvwxyzabcdefghijklmn \
1485 --display-name youruseridhere \
1486 --email s3@example.com
-c $conf_fn > /dev
/null
1487 $CEPH_BIN/radosgw-admin user create \
1488 --uid 56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234 \
1489 --access-key NOPQRSTUVWXYZABCDEFG \
1490 --secret nopqrstuvwxyzabcdefghijklmnabcdefghijklm \
1491 --display-name john.doe \
1492 --email john.doe@example.com
-c $conf_fn > /dev
/null
1493 $CEPH_BIN/radosgw-admin user create \
1495 --uid 9876543210abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
1496 --access-key HIJKLMNOPQRSTUVWXYZA \
1497 --secret opqrstuvwxyzabcdefghijklmnopqrstuvwxyzab \
1498 --display-name tenanteduser \
1499 --email tenanteduser@example.com
-c $conf_fn > /dev
/null
1502 debug
echo "setting up user tester"
1503 $CEPH_BIN/radosgw-admin user create
-c $conf_fn --subuser=test:tester
--display-name=Tester-Subuser
--key-type=swift
--secret=testing
--access=full
> /dev
/null
1506 echo "S3 User Info:"
1507 echo " access key: $s3_akey"
1508 echo " secret key: $s3_skey"
1510 echo "Swift User Info:"
1511 echo " account : test"
1512 echo " user : tester"
1513 echo " password : testing"
1519 if [ "$new" -eq 1 ]; then
1521 if [ -n "$rgw_compression" ]; then
1522 debug
echo "setting compression type=$rgw_compression"
1523 $CEPH_BIN/radosgw-admin zone placement modify
-c $conf_fn --rgw-zone=default
--placement-id=default-placement
--compression=$rgw_compression > /dev
/null
1527 if [ "$cephadm" -gt 0 ]; then
1528 ceph_adm orch apply rgw rgwTest
1533 if [ "$debug" -ne 0 ]; then
1534 RGWDEBUG
="--debug-rgw=20 --debug-ms=1"
1537 local CEPH_RGW_PORT_NUM
="${CEPH_RGW_PORT}"
1538 local CEPH_RGW_HTTPS
="${CEPH_RGW_PORT: -1}"
1539 if [[ "${CEPH_RGW_HTTPS}" = "s" ]]; then
1540 CEPH_RGW_PORT_NUM
="${CEPH_RGW_PORT::-1}"
1545 [ $CEPH_RGW_PORT_NUM -lt 1024 ] && RGWSUDO
=sudo
1547 current_port
=$CEPH_RGW_PORT
1548 for n
in $
(seq 1 $CEPH_NUM_RGW); do
1549 rgw_name
="client.rgw.${current_port}"
1551 ceph_adm auth get-or-create
$rgw_name \
1557 debug
echo start rgw on http
${CEPH_RGW_HTTPS}://localhost
:${current_port}
1558 run
'rgw' $current_port $RGWSUDO $CEPH_BIN/radosgw
-c $conf_fn \
1559 --log-file=${CEPH_OUT_DIR}/radosgw.
${current_port}.log \
1560 --admin-socket=${CEPH_OUT_DIR}/radosgw.
${current_port}.asok \
1561 --pid-file=${CEPH_OUT_DIR}/radosgw.
${current_port}.pid \
1562 --rgw_luarocks_location=${CEPH_OUT_DIR}/luarocks \
1565 "--rgw_frontends=${rgw_frontend} port=${current_port}${CEPH_RGW_HTTPS}"
1568 [ $i -eq $CEPH_NUM_RGW ] && break
1570 current_port
=$
((current_port
+1))
1573 if [ "$CEPH_NUM_RGW" -gt 0 ]; then
1578 if [ $GANESHA_DAEMON_NUM -gt 0 ]; then
1579 pseudo_path
="/cephfs"
1580 if [ "$cephadm" -gt 0 ]; then
1583 prun ceph_adm nfs cluster create
$cluster_id
1584 if [ $CEPH_NUM_MDS -gt 0 ]; then
1585 prun ceph_adm nfs
export create cephfs
--fsname "a" --cluster-id $cluster_id --pseudo-path $pseudo_path
1586 echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint"
1588 if [ "$CEPH_NUM_RGW" -gt 0 ]; then
1590 do_rgw_create_bucket
1591 prun ceph_adm nfs
export create rgw
--cluster-id $cluster_id --pseudo-path $pseudo_path --bucket "nfs-bucket"
1592 echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint"
1596 echo "Mount using: mount -t nfs -o port=<ganesha-port-num> $IP:$pseudo_path mountpoint"
1603 if pgrep
-f podman
> /dev
/null
; then
1605 elif pgrep
-f docker
> /dev
/null
; then
1608 if [ -n "$service" ]; then
1609 echo "using $service for deploying jaeger..."
1610 #check for exited container, remove them and restart container
1611 if [ "$($service ps -aq -f status=exited -f name=jaeger)" ]; then
1614 if [ ! "$(podman ps -aq -f name=jaeger)" ]; then
1618 echo "cannot find docker or podman, please restart service and rerun."
1623 if [ $with_jaeger -eq 1 ]; then
1624 debug
echo "Enabling jaegertracing..."
1625 docker_service run
-d --name jaeger \
1633 jaegertracing
/all-in-one
:1.20
1637 debug
echo "vstart cluster complete. Use stop.sh to stop. See out/* (e.g. 'tail -f out/????') for debug output."
1640 if [ "$new" -eq 1 ]; then
1641 if $with_mgr_dashboard; then
1642 echo "dashboard urls: $DASH_URLS"
1643 echo " w/ user/pass: admin / admin"
1645 echo "restful urls: $RESTFUL_URLS"
1646 echo " w/ user/pass: admin / $RESTFUL_SECRET"
1650 # add header to the environment file
1653 echo "# source this file into your shell to set up the environment."
1654 echo "# For example:"
1655 echo "# $ . $CEPH_DIR/vstart_environment.sh"
1657 } > $CEPH_DIR/vstart_environment.sh
1659 echo "export PYTHONPATH=$PYBIND:$CYTHON_PYTHONPATH:$CEPH_PYTHON_COMMON\$PYTHONPATH"
1660 echo "export LD_LIBRARY_PATH=$CEPH_LIB:\$LD_LIBRARY_PATH"
1661 echo "export PATH=$CEPH_DIR/bin:\$PATH"
1663 if [ "$CEPH_DIR" != "$PWD" ]; then
1664 echo "export CEPH_CONF=$conf_fn"
1665 echo "export CEPH_KEYRING=$keyring_fn"
1668 if [ -n "$CEPHFS_SHELL" ]; then
1669 echo "alias cephfs-shell=$CEPHFS_SHELL"
1671 } |
tee -a $CEPH_DIR/vstart_environment.sh
1675 # always keep this section at the very bottom of this file
1676 STRAY_CONF_PATH
="/etc/ceph/ceph.conf"
1677 if [ -f "$STRAY_CONF_PATH" -a -n "$conf_fn" -a ! "$conf_fn" -ef "$STRAY_CONF_PATH" ]; then
1681 echo " Please remove stray $STRAY_CONF_PATH if not needed."
1682 echo " Your conf files $conf_fn and $STRAY_CONF_PATH may not be in sync"
1683 echo " and may lead to undesired results."
1686 echo " Remember to restart cluster after removing $STRAY_CONF_PATH"