]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
mon: remove mon from cluster before stopping daemon
authorSage Weil <sage@inktank.com>
Wed, 13 Mar 2013 21:45:49 +0000 (14:45 -0700)
committerSage Weil <sage@inktank.com>
Wed, 13 Mar 2013 21:45:49 +0000 (14:45 -0700)
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>
ceph_deploy/mon.py

index caad5b11e3c2a71de7888e569c52b885ae683388..6ca11d8bf33d5e513ec2d925a7dbbef69a0b89e0 100644 (file)
@@ -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=[