fi
if [[ -z "$quorumsize" ]]; then
- timeout $timeout ceph mon_status --format=json >&/dev/null || return 1
+ timeout $timeout ceph quorum_status --format=json >&/dev/null || return 1
return 0
fi
wait_until=$((`date +%s` + $timeout))
while [[ $(date +%s) -lt $wait_until ]]; do
jqfilter='.quorum | length == '$quorumsize
- jqinput="$(timeout $timeout ceph mon_status --format=json 2>/dev/null)"
+ jqinput="$(timeout $timeout ceph quorum_status --format=json 2>/dev/null)"
res=$(echo $jqinput | jq "$jqfilter")
if [[ "$res" == "true" ]]; then
no_quorum=0
timeout 120 ceph -s > /dev/null || return 1
# expect monmap to contain 3 monitors (a, b, and c)
- jqinput="$(ceph mon_status --format=json 2>/dev/null)"
+ jqinput="$(ceph quorum_status --format=json 2>/dev/null)"
jq_success "$jqinput" '.monmap.mons | length == 3' || return 1
# quorum contains two monitors
jq_success "$jqinput" '.quorum | length == 2' || return 1
timeout 300 ceph -s > /dev/null || return 1
- jqinput="$(ceph mon_status --format=json 2>/dev/null)"
+ jqinput="$(ceph quorum_status --format=json 2>/dev/null)"
# expect quorum to have all three monitors
jqfilter='.quorum | length == 3'
jq_success "$jqinput" "$jqfilter" || return 1
port_forward ${MONC_PUBLIC} ${MONC_BIND}
# expect monmap to contain 3 monitors (a, b, and c)
- jqinput="$(ceph mon_status --format=json 2>/dev/null)"
+ jqinput="$(ceph quorum_status --format=json 2>/dev/null)"
jq_success "$jqinput" '.monmap.mons | length == 3' || return 1
# quorum should form
"""
Extract all the monitor status information from the cluster
"""
- addr = self.ctx.ceph[self.cluster].mons['mon.%s' % mon]
- out = self.raw_cluster_cmd('-m', addr, 'mon_status')
+ out = self.raw_cluster_cmd('tell', 'mon.%s' % mon, 'mon_status')
return json.loads(out)
def get_mon_quorum(self):
@classmethod
def mons(cls):
- out = cls.ceph_cluster.mon_manager.raw_cluster_cmd('mon_status')
+ out = cls.ceph_cluster.mon_manager.raw_cluster_cmd('quorum_status')
j = json.loads(out)
return [mon['name'] for mon in j['monmap']['mons']]
ceph mon dump
ceph mon getmap -o $TEMP_DIR/monmap.$$
[ -s $TEMP_DIR/monmap.$$ ]
+
# ceph mon tell
- ceph mon_status
+ first=$(ceph mon dump -f json | jq -r '.mons[0].name')
+ ceph tell mon.$first mon_status
# test mon features
ceph mon feature ls
expect_to_file(
'ceph auth get-or-create client.caps mon \'allow command "auth caps"' \
' with entity="client.caps"\'', 0, k)
- expect('ceph -n client.caps -k {kf} mon_status'.format(kf=k), errno.EACCES)
+ expect('ceph -n client.caps -k {kf} quorum_status'.format(kf=k), errno.EACCES)
expect('ceph -n client.caps -k {kf} auth caps client.caps mon \'allow *\''.format(kf=k), 0)
- expect('ceph -n client.caps -k {kf} mon_status'.format(kf=k), 0)
+ expect('ceph -n client.caps -k {kf} quorum_status'.format(kf=k), 0)
destroy_keyring(k)
def main():
}
expect "ceph auth get-or-create client.bazar > $tmp.bazar.keyring" 0
-expect "ceph -k $tmp.bazar.keyring --user bazar mon_status" 13
+expect "ceph -k $tmp.bazar.keyring --user bazar quorum_status" 13
ceph auth del client.bazar
-c="'allow command \"auth ls\", allow command mon_status'"
+c="'allow command \"auth ls\", allow command quorum_status'"
expect "ceph auth get-or-create client.foo mon $c > $tmp.foo.keyring" 0
-expect "ceph -k $tmp.foo.keyring --user foo mon_status" 0
+expect "ceph -k $tmp.foo.keyring --user foo quorum_status" 0
expect "ceph -k $tmp.foo.keyring --user foo auth ls" 0
expect "ceph -k $tmp.foo.keyring --user foo auth export" 13
expect "ceph -k $tmp.foo.keyring --user foo auth del client.bazar" 13
expect "ceph -k $tmp.foo.keyring --user foo quorum_status" 13
ceph auth del client.foo
-c="'allow command service with prefix=list, allow command mon_status'"
+c="'allow command service with prefix=list, allow command quorum_status'"
expect "ceph auth get-or-create client.bar mon $c > $tmp.bar.keyring" 0
-expect "ceph -k $tmp.bar.keyring --user bar mon_status" 0
+expect "ceph -k $tmp.bar.keyring --user bar quorum_status" 0
expect "ceph -k $tmp.bar.keyring --user bar auth ls" 13
expect "ceph -k $tmp.bar.keyring --user bar auth export" 13
expect "ceph -k $tmp.bar.keyring --user bar auth del client.foo" 13