Configuring Hostnames
- Configure the permanent static host names. Set the names of the servers to ceph1 to ceph3 and the names of the clients to client1 to client3.
- Configure the server nodes.
Set the host name of server node 1 to ceph1:
1hostnamectl --static set-hostname ceph1

Set hostnames for other server nodes in the same way.
- Set host names for client nodes.
Set the host name of client node 1 to client1:
1hostnamectl --static set-hostname client1
Set hostnames for other client nodes in the same way.
- Configure the server nodes.
- Modify the domain name resolution file.1. Open the domain name resolution file.
1vi /etc/hosts2. Press i to enter the insert mode. Add the following content to the /etc/hosts file on each server node and client node in the cluster.
192.168.3.166 ceph1 192.168.3.167 ceph2 192.168.3.168 ceph3 192.168.3.160 client1 192.168.3.161 client2 192.168.3.162 client3
3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
Check whether the network between the servers and clients is normal. If the response is correct, the domain name resolution file is successfully modified. For example, log in to ceph1 and check whether the network between ceph1 and ceph2 is normal.
[root@ceph1 ~]# ping ceph2
The configuration is successful if the following information is displayed:
PING ceph2 (192.168.3.167) 56(84) bytes of data. 64 bytes from ceph2 (192.168.3.167): icmp_seq=1 ttl=64 time=0.175 ms 64 bytes from ceph2 (192.168.3.167): icmp_seq=2 ttl=64 time=0.085 ms 64 bytes from ceph2 (192.168.3.167): icmp_seq=3 ttl=64 time=0.083 ms ... --- ceph2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2043ms
Parent topic: Configuring the System