mirror of https://github.com/ceph/go-ceph
ci: prepare micro-osd.sh for cross-container connections
Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
parent
014a3f6308
commit
3fb003d886
17
micro-osd.sh
17
micro-osd.sh
|
@ -32,6 +32,7 @@ mkdir ${LOG_DIR} ${MON_DATA} ${OSD_DATA} ${MDS_DATA} ${MOUNTPT}
|
||||||
MDS_NAME="Z"
|
MDS_NAME="Z"
|
||||||
MON_NAME="a"
|
MON_NAME="a"
|
||||||
MGR_NAME="x"
|
MGR_NAME="x"
|
||||||
|
MIRROR_ID="m"
|
||||||
|
|
||||||
# cluster wide parameters
|
# cluster wide parameters
|
||||||
cat >> ${DIR}/ceph.conf <<EOF
|
cat >> ${DIR}/ceph.conf <<EOF
|
||||||
|
@ -43,9 +44,10 @@ auth cluster required = none
|
||||||
auth service required = none
|
auth service required = none
|
||||||
auth client required = none
|
auth client required = none
|
||||||
osd pool default size = 1
|
osd pool default size = 1
|
||||||
|
mon host = ${HOSTNAME}
|
||||||
|
|
||||||
[mds.${MDS_NAME}]
|
[mds.${MDS_NAME}]
|
||||||
host = localhost
|
host = ${HOSTNAME}
|
||||||
|
|
||||||
[mon.${MON_NAME}]
|
[mon.${MON_NAME}]
|
||||||
log file = ${LOG_DIR}/mon.log
|
log file = ${LOG_DIR}/mon.log
|
||||||
|
@ -53,7 +55,7 @@ chdir = ""
|
||||||
mon cluster log file = ${LOG_DIR}/mon-cluster.log
|
mon cluster log file = ${LOG_DIR}/mon-cluster.log
|
||||||
mon data = ${MON_DATA}
|
mon data = ${MON_DATA}
|
||||||
mon data avail crit = 0
|
mon data avail crit = 0
|
||||||
mon addr = 127.0.0.1
|
mon addr = ${HOSTNAME}
|
||||||
mon allow pool delete = true
|
mon allow pool delete = true
|
||||||
|
|
||||||
[osd.0]
|
[osd.0]
|
||||||
|
@ -76,10 +78,9 @@ ceph-mon --id ${MON_NAME}
|
||||||
|
|
||||||
# start an osd
|
# start an osd
|
||||||
OSD_ID=$(ceph osd create)
|
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
|
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
|
# 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
|
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
|
# start a manager
|
||||||
ceph-mgr --id ${MGR_NAME}
|
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
|
# test the setup
|
||||||
ceph --version
|
ceph --version
|
||||||
ceph status
|
ceph status
|
||||||
|
@ -106,3 +111,5 @@ rados --pool ${test_pool} get group ${temp_file}
|
||||||
diff /etc/group ${temp_file}
|
diff /etc/group ${temp_file}
|
||||||
ceph osd pool delete ${test_pool} ${test_pool} --yes-i-really-really-mean-it
|
ceph osd pool delete ${test_pool} ${test_pool} --yes-i-really-really-mean-it
|
||||||
rm ${temp_file}
|
rm ${temp_file}
|
||||||
|
|
||||||
|
touch ${DIR}/.ready
|
||||||
|
|
Loading…
Reference in New Issue