Configuring the Environment
This section uses three servers and three clients as an example.
- Set the host name on each node.
1 2 3 4 5 6
hostnamectl set-hostname ceph1 hostnamectl set-hostname ceph2 hostnamectl set-hostname ceph3 hostnamectl set-hostname client1 hostnamectl set-hostname client2 hostnamectl set-hostname client3
- Configure machine name resolution on ceph1 to ceph3.
- Open the following file.
1vim /etc/hosts - Press i to enter the insert mode and add the following content to the file:
1 2 3 4 5 6
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
- The example IP addresses are those planned in Environment Networking. Replace them with the actual ones. You can run the ip a command to query the actual IP addresses.
- In this document, the cluster consists of three server nodes and three client nodes. Modify the commands based on the actual number of nodes.
- Press Esc to exit the insert mode. Type :wq! and press Enter to save and exit the file.
- Open the following file.
- Run the following commands on ceph1, ceph2, and ceph3 respectively to configure password-free login:
1 2
ssh-keygen -t rsa for i in {1..3};do ssh-copy-id ceph$i;done
- Disable the firewall.
1 2 3
systemctl stop firewalld systemctl disable firewalld systemctl status firewalld
- Disable SELinux.
1 2
setenforce 0 sed -i 's/=permissive/=disabled/g' /etc/selinux/config
- Configure clock synchronization on ceph1, ceph2, and ceph3.
- Install the chrony service.
1dnf install -y chrony
- Back up the configuration file.
1mv /etc/chrony.conf /etc/chrony.conf.bak
- Modify the configuration file.
1 2 3 4 5
cat > /etc/chrony.conf <<EOF server [IP1] iburst allow [IP/MASK] local stratum 10 EOF
- [IP1] indicates the IP address or domain name of the server that provides the clock service on the network, for example, 192.168.3.166.
- [IP/MASK] indicates the IP address range of the local network, for example, 192.168.1.0/24. Only devices within this subnet can synchronize the clock with the server.
- Restart chrony.
1 2
systemctl restart chronyd systemctl enable chronyd
- Check the time synchronization status.
1 2 3
chronyc -a makestep # Forcibly synchronize the system time. chronyc sourcestats # Display the synchronization statistics of the current time source. chronyc sources -v # Display detailed information about the current time source.
- Install the chrony service.
Parent topic: Deploying Ceph