This fixes a transition from 2->1 mons, where the second mon needs to be in
the quorum in order to remove itself.
Signed-off-by: Sage Weil <sage@inktank.com>
)
if os.path.exists(path):
+ # remove from cluster
+ subprocess.check_call(
+ args=[
+ 'sudo',
+ 'ceph',
+ '--cluster={cluster}'.format(cluster=cluster),
+ '-n', 'mon.',
+ '-k', '{path}/keyring'.format(path=path),
+ 'mon',
+ 'remove',
+ hostname,
+ ],
+ )
+
# stop
if os.path.exists(os.path.join(path, 'upstart')):
subprocess.call( # ignore initctl error when job not running
],
)
- # remove from cluster
- subprocess.check_call(
- args=[
- 'sudo',
- 'ceph',
- '--cluster={cluster}'.format(cluster=cluster),
- '-n', 'mon.',
- '-k', '{path}/keyring'.format(path=path),
- 'mon',
- 'remove',
- hostname,
- ],
- )
-
# delete monitor directory
subprocess.check_call(
args=[