https://docs.ceph.com/docs/master/rados/operations/add-or-rm-mons/
Remove
# ceph mon dump
dumped monmap epoch 24
epoch 24
fsid 5c503097-de43-44c8-b08b-2b5c5341cc2d
last_changed 2019-12-04 13:27:09.191918
created 2019-08-30 21:07:32.252233
min_mon_release 14 (nautilus)
0: [v2:192.168.0.2:3300/0,v1:192.168.0.2:6789/0] mon.ceph-mon1
1: [v2:192.168.0.1:3300/0,v1:192.168.0.1:6789/0] mon.ceph-mon0
2: [v2:192.168.0.3:3300/0,v1:192.168.0.3:6789/0] mon.ceph-mon2
# ceph mon remove ceph-mon1
removing mon.ceph-mon1 at [v2:192.168.0.2:3300/0,v1:192.168.0.2:6789/0], there will be 2 monitors
# ceph mon dump
dumped monmap epoch 25
epoch 25
fsid 5c503097-de43-44c8-b08b-2b5c5341cc2d
last_changed 2019-12-04 13:40:44.184296
created 2019-08-30 21:07:32.252233
min_mon_release 14 (nautilus)
0: [v2:192.168.0.1:3300/0,v1:192.168.0.1:6789/0] mon.ceph-mon0
1: [v2:192.168.0.3:3300/0,v1:192.168.0.3:6789/0] mon.ceph-mon2
Add
# mkdir /root/tmp
# monmaptool --create --add ceph-mon1 192.168.0.2:6789 --clobber /root/tmp/keyring
monmaptool: monmap file /root/tmp/keyring
monmaptool: generated fsid 7b7a45e0-f3ed-4d4f-b233-4cba75c9aaeb
monmaptool: writing epoch 0 to /root/tmp/keyring (1 monitors)
# ceph auth get mon. -o /root/tmp/keyring
exported keyring for mon.
# ceph mon getmap -o /root/tmp/monmap
got monmap epoch 25
# ceph-mon -i ceph-mon1 --mkfs --monmap /root/tmp/monmap --keyring /root/tmp/keyring
2019-12-04 13:46:08.145 7f4e310c7200 -1 '/var/lib/ceph/mon/ceph-ceph-mon1' already exists and is not empty: monitor may already exist
µð·ºÅ丮 ¹é¾÷ --> »ý¼º
# mv ceph-ceph-mon1/ ceph-ceph-mon1_bak
# mkdir ceph-ceph-mon1
# ceph-mon -i ceph-mon1 --mkfs --monmap /root/tmp/monmap --keyring /root/tmp/keyring
# chown -R ceph:ceph ceph-ceph-mon1
# ceph-mon -i ceph-mon1 --public-addr 192.168.0.2:6789
# ceph mon add ceph-mon1 192.168.0.2:6789
adding mon.ceph-mon1 at [v2:192.168.0.2:3300/0,v1:192.168.0.2:6789/0]
# ceph mon enable-msgr2
ÀÏÁ¤½Ã°£ÀÖ´Ù°¡ ¿Ã¶ó¿È..
# systemctl status ceph-mon@ceph-mon1
¡Ü ceph-mon@ceph-mon1.service - Ceph cluster monitor daemon
Loaded: loaded (/usr/lib/systemd/system/ceph-mon@.service; enabled; vendor preset: disabled)
Active: active (running) since ¼ö 2019-12-04 14:59:59 KST; 27s ago
Main PID: 414676 (ceph-mon)
CGroup: /system.slice/system-ceph\x2dmon.slice/ceph-mon@ceph-mon1.service
¦¦¦¡414676 /usr/bin/ceph-mon -f --cluster ceph --id ceph-mon1 --setuser ceph --setgroup ceph