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