Manually add a ceph-mon

Sometimes it's necessary to rebuild the content of a Ceph monitor's local database, E.G it becomes corrupt or you somehow loose it! This process assumes the cluster is running and the remaining mons have achieved quorum, in which case it's safe to blow away the local DB of a single mon and let it re-create from the remaining mons.

Warning

As always, be careful! I don't take any responsibility if you nuke your Ceph cluster!

 1mkdir /tmp/cephmon
 2ceph auth get mon. -o /tmp/cephmon/mon.key
 3ceph mon getmap -o /tmp/cephmon/monmap
 4sudo ceph-mon -i mon-hostname --mkfs --monmap /tmp/cephmon/monmap --keyring /tmp/cephmon/mon.key
 5ceph-mon -i mon-hostname --public-addr 10.50.1.71
 6
 7ps ax | grep ceph-mon
 8kill {mon-pid}
 9
10chown ceph:ceph /var/lib/ceph/mon/ -R
11systemctl enable ceph-mon@mon-hostname.service
12systemctl start ceph-mon@mon-hostname.service
13systemctl status ceph-mon@mon-hostname.service