此内容没有您所选择的语言版本。
Chapter 12. Remove a Monitor
When you remove monitors from a cluster, consider that Ceph monitors use PAXOS to establish consensus about the master cluster map. You must have a sufficient number of monitors to establish a quorum for consensus about the cluster map.
12.1. ceph-deploy 复制链接链接已复制到粘贴板!
To remove a monitor from your cluster, use the mon destroy
command.
ceph-deploy mon destroy <ceph-node> [<ceph-node>]
ceph-deploy mon destroy <ceph-node> [<ceph-node>]
For example, to remove Ceph monitors on monitor hosts node5
and node6
, you would execute the following:
ceph-deploy mon destroy node5 node6
ceph-deploy mon destroy node5 node6
Check to see that your monitors have left the quorum.
ceph quorum_status --format json-pretty
ceph quorum_status --format json-pretty
Ensure that you remove any references to this monitor in your Ceph configuration file; then, push a new copy of the Ceph configuration file to your Ceph nodes.
Ideally, you should remove the monitor host from Calamari. Get the cluster ID:
http://{calamari-fqdn}/api/v2/cluster
http://{calamari-fqdn}/api/v2/cluster
Then, remove the monitor host from Calamari.
http://{calamari-fqdn}/api/v2/server http://{calamari-fqdn}/api/v2/key/{host-fqdn}
http://{calamari-fqdn}/api/v2/server
http://{calamari-fqdn}/api/v2/key/{host-fqdn}
12.2. manual 复制链接链接已复制到粘贴板!
This procedure removes a ceph-mon
daemon from your cluster. If this procedure results in only two monitor daemons, you may add or remove another monitor until you have a number of ceph-mon
daemons that can achieve a quorum.
Stop the monitor. :
service ceph -a stop mon.{mon-id}
service ceph -a stop mon.{mon-id}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the monitor from the cluster. :
ceph mon remove {mon-id}
ceph mon remove {mon-id}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Remove the monitor entry from
ceph.conf
.
12.3. Removing Monitors from an Unhealthy Cluster 复制链接链接已复制到粘贴板!
This procedure removes a ceph-mon
daemon from an unhealhty cluster—i.e., a cluster that has placement groups that are persistently not active + clean
.
Identify a surviving monitor and log in to that host. :
ceph mon dump ssh {mon-host}
ceph mon dump ssh {mon-host}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Stop the
ceph-mon
daemon and extract a copy of the monap file. :service ceph stop mon || stop ceph-mon-all ceph-mon -i {mon-id} --extract-monmap {map-path} # for example, ceph-mon -i a --extract-monmap /tmp/monmap
service ceph stop mon || stop ceph-mon-all ceph-mon -i {mon-id} --extract-monmap {map-path} # for example, ceph-mon -i a --extract-monmap /tmp/monmap
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the non-surviving monitors. For example, if you have three monitors,
mon.a
,mon.b
, andmon.c
, where onlymon.a
will survive, follow the example below:monmaptool {map-path} --rm {mon-id} # for example, monmaptool /tmp/monmap --rm b monmaptool /tmp/monmap --rm c
monmaptool {map-path} --rm {mon-id} # for example, monmaptool /tmp/monmap --rm b monmaptool /tmp/monmap --rm c
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Inject the surviving map with the removed monitors into the surviving monitors. For example, to inject a map into monitor
mon.a
, follow the example below:ceph-mon -i {mon-id} --inject-monmap {map-path} # for example, ceph-mon -i a --inject-monmap /tmp/monmap
ceph-mon -i {mon-id} --inject-monmap {map-path} # for example, ceph-mon -i a --inject-monmap /tmp/monmap
Copy to Clipboard Copied! Toggle word wrap Toggle overflow