Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / mon / bootstrap / single_host_multi.sh
1 #!/bin/sh -ex
2
3 cwd=`pwd`
4 cat > conf <<EOF
5 [global]
6
7 [mon]
8 admin socket = 
9 log file = $cwd/\$name.log
10 debug mon = 20
11 debug ms = 1
12 mon host = 127.0.0.1:6789 127.0.0.1:6790 127.0.0.1:6791
13 EOF
14
15 rm -f mm
16 fsid=`uuidgen`
17
18 rm -f keyring
19 ceph-authtool --create-keyring keyring --gen-key -n client.admin
20 ceph-authtool keyring --gen-key -n mon.
21
22 ceph-mon -c conf -i a --mkfs --fsid $fsid --mon-data $cwd/mon.a -k keyring --public-addr 127.0.0.1:6789
23 ceph-mon -c conf -i b --mkfs --fsid $fsid --mon-data $cwd/mon.b -k keyring --public-addr 127.0.0.1:6790
24 ceph-mon -c conf -i c --mkfs --fsid $fsid --mon-data $cwd/mon.c -k keyring --public-addr 127.0.0.1:6791
25
26 ceph-mon -c conf -i a --mon-data $cwd/mon.a
27 ceph-mon -c conf -i b --mon-data $cwd/mon.b
28 ceph-mon -c conf -i c --mon-data $cwd/mon.c
29
30 ceph -c conf -k keyring health -m 127.0.0.1
31 while true; do
32     if ceph -c conf -k keyring -m 127.0.0.1 mon stat | grep 'a,b,c'; then
33         break
34     fi
35     sleep 1
36 done
37
38 killall ceph-mon
39 echo OK