Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of adding monitor to the existing Ceph cluster

Shulou Source: shulou.com Published: 2022-06-01 10:57:07 10月25日 Update

This article focuses on "how to add monitor to existing Ceph clusters". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to add monitor to an existing Ceph cluster.

The method to add monitor to an existing Ceph cluster is as follows:

1. Create a working directory for the newly created monitor.

# mkdir-p / var/lib/ceph/mon/ceph-b

# mkdir-p / var/lib/ceph/mon/ceph-c

2. Create a temporary directory to hold the monitor map and monitor keyring in the current cluster.

# mkdir-p / tmp/mon-tmp

3. Get the keyring of monitor from the current ceph cluster.

# ceph auth get mon. -o / tmp/mon-tmp/mon.keyring

4. Get the monmap of monitor from the current ceph cluster.

# ceph mon getmap-o / tmp/mon-tmp/mon.monmap

5. Initialize the newly created monitor working directory.

# ceph-mon-I b-- mkfs-- monmap / tmp/mon-tmp/mon.monmap-- keyring / tmp/mon-tmp/mon.keyring

# ceph-mon-I c-- mkfs-- monmap / tmp/mon-tmp/mon.monmap-- keyring / tmp/mon-tmp/mon.keyring

6. Add the newly created montiors to the ceph.conf

[mon.b]

Host = node2

Mon addr = 192.168.0.36VR 6789

[mon.c]

Host = node2

Mon addr = 192.168.0.36VR 6790

7. Start the newly created monitors with the command.

# / etc/init.d/ceph start mon.b

# / etc/init.d/ceph start mon.c

At this point, use the cluster status view command # ceph-s to see that there are 2 more monmap.

The method to delete monitor from an existing Ceph cluster is as follows:

The method to delete monitor when the current status is HEALTH_OK is relatively simple. The specific steps are as follows:

1. Stop the monitor process to be deleted, that is:

# / etc/init.d/ceph-a stop mon.c # this step only stops the monitor process, but does not affect the monmap in the cluster

2. Delete monitor from the cluster.

# ceph mon remove c # this step removes monitor c from the cluster

3. Delete the specified monitor from the ceph.conf file.

More steps are required to delete monitor when the current status is non-HEALTH_OK, as shown below:

1. Stop all monitor in the cluster, that is:

# / etc/init.d/ceph-a stop mon

2. Log in to the undeleted monitor node, and then obtain the monmap information of the cluster, that is:

# ceph-mon-I a-- extract-monmap / tmp/monmap

3. View the monitor map information of the current cluster.

# monmaptool-- print / tmp/monmap # you will see the monmap information being used in the cluster at this time

4. Delete the specified monitor from monmap, that is:

# monmaptool / tmp/monmap-- rm c # remove monitor c from the monmap in the cluster

5. Update the monmap in the cluster, that is:

# ceph-mon-I a-- inject-monmap / tmp/monmap

6. Delete the information about the deleted monitor in the ceph.conf file.

7. Restart monitors in the cluster.

# / etc/init.d/ceph-a start mon

When you use the cluster status view tool # ceph-s to view it at this time, the output result has one less osdmap entry than before.

At this point, I believe you have a deeper understanding of "the method of adding monitor to the existing Ceph cluster". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Cluster method step information status directory content command situation file more process study work practical deeper interest just practical practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information OPPO Reno Microsoft Shulou Technology