ci: prepare micro-osd.sh for cross-container connections

Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
Sven Anderson 2021-03-03 18:06:01 +01:00 committed by John Mulligan
parent 014a3f6308
commit 3fb003d886
1 changed files with 12 additions and 5 deletions

View File

@ -32,6 +32,7 @@ mkdir ${LOG_DIR} ${MON_DATA} ${OSD_DATA} ${MDS_DATA} ${MOUNTPT}
MDS_NAME="Z"
MON_NAME="a"
MGR_NAME="x"
MIRROR_ID="m"
# cluster wide parameters
cat >> ${DIR}/ceph.conf <<EOF
@ -43,9 +44,10 @@ auth cluster required = none
auth service required = none
auth client required = none
osd pool default size = 1
mon host = ${HOSTNAME}
[mds.${MDS_NAME}]
host = localhost
host = ${HOSTNAME}
[mon.${MON_NAME}]
log file = ${LOG_DIR}/mon.log
@ -53,7 +55,7 @@ chdir = ""
mon cluster log file = ${LOG_DIR}/mon-cluster.log
mon data = ${MON_DATA}
mon data avail crit = 0
mon addr = 127.0.0.1
mon addr = ${HOSTNAME}
mon allow pool delete = true
[osd.0]
@ -76,10 +78,9 @@ ceph-mon --id ${MON_NAME}
# start an osd
OSD_ID=$(ceph osd create)
ceph osd crush add osd.${OSD_ID} 1 root=default host=localhost
ceph osd crush add osd.${OSD_ID} 1 root=default
ceph-osd --id ${OSD_ID} --mkjournal --mkfs
sleep 5 # this is an attempt to fix CI issue #423, remove if it has no effect
ceph-osd --id ${OSD_ID}
ceph-osd --id ${OSD_ID} || ceph-osd --id ${OSD_ID} || ceph-osd --id ${OSD_ID}
# start an mds for cephfs
ceph auth get-or-create mds.${MDS_NAME} mon 'profile mds' mgr 'profile mds' mds 'allow *' osd 'allow *' > ${MDS_DATA}/keyring
@ -95,6 +96,10 @@ while [[ ! $(ceph mds stat | grep "up:active") ]]; do sleep 1; done
# start a manager
ceph-mgr --id ${MGR_NAME}
# start rbd-mirror
ceph auth get-or-create client.rbd-mirror.${MIRROR_ID} mon 'profile rbd-mirror' osd 'profile rbd'
rbd-mirror --id ${MIRROR_ID} --log-file ${LOG_DIR}/rbd-mirror.log
# test the setup
ceph --version
ceph status
@ -106,3 +111,5 @@ rados --pool ${test_pool} get group ${temp_file}
diff /etc/group ${temp_file}
ceph osd pool delete ${test_pool} ${test_pool} --yes-i-really-really-mean-it
rm ${temp_file}
touch ${DIR}/.ready