1 Overview
1) ceph version: nautilus version
2) Cluster environment:
2.1) Ceph cluster:
ceph-deploy initializes two monitor nodes. Now I want to add another monitor node.
2.2) The working directory of ceph-deploy is: /etc/ceph-deploy/ceph/
2.3) The hosts file:
[root@m1 ceph]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.39.19 master
192.168.39.20 node1
192.168.39.21 datanode2
2) An error is reported when joining the monitor node for the first time
Enter the working directory of ceph-deploy: cd /etc/ceph-deploy/ceph/
Execute the command:
ceph-deploy mon add datanode2 --address 192.168.39.21
The error information of the ceph-deploy command is as follows, and the error information of the target ceph monitor process is the same as the printed information in the screenshot, telling the user that the monitor node to be added is not in the ceph monmap.
3) Solution
1) Step 1: Modify the /etc/ceph-deploy/ceph/ceph.conf file and add the information of the monitor node to be added and the public_network field.
Step 2: Push the modified ceph.conf file to all servers in the ceph cluster
cd /etc/ceph-deploy/ceph/
ceph-deploy --overwrite-conf config push master node1 datanode2
Step 3: Add monitor node
cd /etc/ceph-deploy/ceph/
ceph-deploy mon add datanode2
As a result of the command execution, add the monitori node: