How to download, edit, and upload a MON map in a Ceph cluster?
Environment
-
Red Hat Ceph Storage 1.2.3
-
Red Hat Ceph Storage 1.3.x
-
Red Hat Ceph Storage 2.x
Issue
-
How to manipulate the monitor map in a Ceph cluster?
-
How to manually edit a monitor map and upload it back to the Ceph cluster?
Resolution
1.Download the monitor map using:
# ceph mon getmap -o /tmp/mon_map.bin
2.View the monitor map with:
# monmaptool --print /tmp/mon_map.bin
3.Edit the monmap with the 'monmaptool' command. In most cases, adding or removing a monitor would be the use case.
# monmaptool --rm mon_node2 /tmp/mon_map.bin
OR
# monmaptool --add mon_node /tmp/mon_map.bin
- For more options, read the man page of 'monmaptool'.
# man monmaptool
4.Check if the monitor map is updated with the changes
# monmaptool --print /tmp/mon_map.bin
5.Prior uploading the changed/updated monitor map, make sure that the monitor service is not running.
# service ceph stop mon
6.Upload the monitor map to the local monitor db
# ceph-mon -i <monitor_node> --inject-monmap /tmp/mon_map.bin
7.Start the mon process
# service ceph start mon
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.