2019-09-26 21:46:49 +00:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
2019-10-25 02:27:27 +00:00
|
|
|
fsid='00000000-0000-0000-0000-0000deadbeef'
|
2019-11-09 14:01:37 +00:00
|
|
|
image='ceph/daemon-base:latest-master-devel'
|
2019-10-07 21:48:19 +00:00
|
|
|
[ -z "$ip" ] && ip=127.0.0.1
|
2019-09-26 21:46:49 +00:00
|
|
|
|
2019-11-07 15:41:23 +00:00
|
|
|
CEPH_DAEMON=../src/ceph-daemon/ceph-daemon
|
|
|
|
|
2019-10-09 17:50:47 +00:00
|
|
|
#A="-d"
|
|
|
|
|
2019-11-07 15:41:23 +00:00
|
|
|
$CEPH_DAEMON $A rm-cluster --fsid $fsid --force
|
2019-09-26 21:46:49 +00:00
|
|
|
|
2019-09-27 14:50:40 +00:00
|
|
|
cat <<EOF > c
|
|
|
|
[global]
|
|
|
|
log to file = true
|
|
|
|
EOF
|
|
|
|
|
2019-11-07 15:41:23 +00:00
|
|
|
$CEPH_DAEMON $A \
|
2019-09-30 22:01:51 +00:00
|
|
|
--image $image \
|
|
|
|
bootstrap \
|
|
|
|
--mon-id a \
|
|
|
|
--mgr-id x \
|
|
|
|
--fsid $fsid \
|
2019-10-07 21:48:19 +00:00
|
|
|
--mon-ip $ip \
|
2019-09-30 22:01:51 +00:00
|
|
|
--config c \
|
|
|
|
--output-keyring k \
|
2019-10-30 15:05:24 +00:00
|
|
|
--output-config c
|
2019-09-26 21:46:49 +00:00
|
|
|
chmod 644 k c
|
|
|
|
|
2019-10-07 21:48:19 +00:00
|
|
|
if [ -n "$ip2" ]; then
|
|
|
|
# mon.b
|
2019-11-07 15:41:23 +00:00
|
|
|
$CEPH_DAEMON $A \
|
2019-09-30 22:01:51 +00:00
|
|
|
--image $image \
|
|
|
|
deploy --name mon.b \
|
|
|
|
--fsid $fsid \
|
2019-11-08 22:11:19 +00:00
|
|
|
--mon-addrv "[v2:$ip2:3300,v1:$ip2:6789]" \
|
2019-09-30 22:01:51 +00:00
|
|
|
--keyring /var/lib/ceph/$fsid/mon.a/keyring \
|
|
|
|
--config c
|
2019-10-07 21:48:19 +00:00
|
|
|
fi
|
2019-09-27 16:41:32 +00:00
|
|
|
|
|
|
|
# mgr.b
|
|
|
|
bin/ceph -c c -k k auth get-or-create mgr.y \
|
|
|
|
mon 'allow profile mgr' \
|
|
|
|
osd 'allow *' \
|
|
|
|
mds 'allow *' > k-mgr.y
|
2019-11-07 15:41:23 +00:00
|
|
|
$CEPH_DAEMON $A \
|
2019-09-30 22:01:51 +00:00
|
|
|
--image $image \
|
|
|
|
deploy --name mgr.y \
|
|
|
|
--fsid $fsid \
|
|
|
|
--keyring k-mgr.y \
|
|
|
|
--config c
|
2019-09-27 16:41:32 +00:00
|
|
|
|
2019-09-27 19:56:43 +00:00
|
|
|
# mds.{k,j}
|
|
|
|
for id in k j; do
|
|
|
|
bin/ceph -c c -k k auth get-or-create mds.$id \
|
|
|
|
mon 'allow profile mds' \
|
|
|
|
mgr 'allow profile mds' \
|
|
|
|
osd 'allow *' \
|
|
|
|
mds 'allow *' > k-mds.$id
|
2019-11-07 15:41:23 +00:00
|
|
|
$CEPH_DAEMON $A \
|
2019-09-30 22:01:51 +00:00
|
|
|
--image $image \
|
|
|
|
deploy --name mds.$id \
|
|
|
|
--fsid $fsid \
|
|
|
|
--keyring k-mds.$id \
|
|
|
|
--config c
|
2019-09-27 19:56:43 +00:00
|
|
|
done
|
2019-09-27 16:41:32 +00:00
|
|
|
|
2019-09-26 21:46:49 +00:00
|
|
|
bin/ceph -c c -k k -s
|