From: Sage Weil Date: Wed, 13 Mar 2013 21:45:49 +0000 (-0700) Subject: mon: remove mon from cluster before stopping daemon X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e38588287b50b32e1a7e98b3032147390db8a00e;p=ceph-deploy.git mon: remove mon from cluster before stopping daemon 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 --- diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index caad5b1..6ca11d8 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -158,6 +158,20 @@ def destroy_mon(cluster): ) 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 @@ -179,20 +193,6 @@ def destroy_mon(cluster): ], ) - # 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=[