Original link: https://blog.csdn.net/lzw06061139/article/details/51953900
Gets monmap
to dump the current Ceph cluster monmap to / tmp / monmap file
[root @ Ceph-xxx-xxx ~] # Ceph Mon GetMap -o / tmp / monmap
GOT monmap Epoch 4
View monmap content
My example has three Ceph Monitor node in the cluster
@ XXX-Ceph-the root XXX ~] # monmaptool --print / tmp / monmap
monmaptool: monmap File / tmp / monmap
Epoch. 4
FSID 1ee20ded-CAAE-419d-9fe3-5919f129cf55
last_changed 2016-02-26. 17: 10: 47.603764
Created 0.000000
0: XXX-XXX-192.168.xxx.xxx:6789/0 mon.ceph
remove monitor node information
by one of deleting the node information monmap:
root@ceph-xxx-xxx ~]# monmaptool --rm ceph-xxx-xxx /tmp/monmap
monmaptool: monmap file /tmp/monmap
monmaptool: removing ceph-xxx-xxx
monmaptool: writing epoch 4 to /tmp/monmap (2 monitors)
// delete the three nodes as described above, / tmp / content monmap follows:
[the root Ceph-XXX-XXX @ ~] # monmaptool --print / tmp / monmap
monmaptool: monmap File / tmp / monmap
Epoch. 4
FSID 1ee20ded 419d-9fe3-5919f129cf55--caae
last_changed 2016-02-26. 17: 10: 47.603764
Created 0.000000
add monitor node
after deleting the original information monitor, add three new monitor node, as follows:
[root@ceph-xxx-xxx ~]# monmaptool --add ceph-xxx-xxm 192.168.xxx.xxm:6789 /tmp/monmap
monmaptool: monmap file /tmp/monmap
monmaptool: writing epoch 4 to /tmp/monmap (1 monitors)
// After the addition was complete a new monitor node, / tmp / monmap follows
[the root Ceph-XXX-XXX @ ~] # monmaptool --print / tmp / monmap
monmaptool: monmap File / tmp / monmap
Epoch. 4
FSID 1ee20ded-CAAE 9fe3-5919f129cf55--419d
last_changed 2016-02-26. 17: 10: 47.603764
Created 0.000000
0: 192.168.xxx.xxm: 6789/0 mon.ceph XXM-XXX-
modified node ip address
by modifying the / etc / sysconfig / network- scripts / ifcfg-eth * file, modify ip address of each node, and then restart the complete modification ip network service, the command is as follows:
[root@ceph-xxx-xxx ~]#ifdown eth* && ifup eth*
Modify ceph.conf
modify mon_host ceph.conf configuration on the admin node, and then pushed through ceph-deploy to monitor all the nodes:
[root@ceph-xxx-xxm ~]#cat ceph.conf
[global]
......
mon_host = 192.168.xxx.xxm,192.168.xxx.xxn,192.168.xxx.xxl
......
[root @ ceph-xxx-xxm ~] # ceph-deploy admin overwrite-conf ceph-xxx-xxm ceph-xxx-xxn ceph-xxx-xxl
stop monitor and inject new monmap
stop monitor service on each node, the / tmp / monmap copied file to other nodes, and inject new record monmap:
[root@ceph-xxx-xxm ~]#/etc/init.d/ceph stop mon
[root@ceph-xxx-xxm ~]#ceph-mon -i ceph-xxx-xxm --inject-monmap /tmp/monmap
Start monitor
Start monitor service on each node:
[root@ceph-xxx-xxm ~]# /etc/init.d/ceph start mon
Restart OSD
final restart all OSD services:
[root@ceph-xxx-xxm ~]# /etc/init.d/ceph restart osd