Configuring NTP
Ceph automatically checks the time of storage nodes. If the time difference between nodes is large, an alarm is generated. Therefore, you need to configure the Network Time Protocol (NTP) to synchronize the time between nodes, thereby improving network management efficiency.
- Install and configure the NTP service.
- Install NTP on all server and client nodes.
1yum -y install ntp ntpdate

- Back up the existing configuration on each server node and client node.
1cd /etc && mv ntp.conf ntp.conf.bak
- Create an NTP file on ceph1, which serves as the NTP server.
1vi /etc/ntp.confPress i to enter the insert mode and add the following content:1 2 3 4 5
restrict 127.0.0.1 restrict ::1 restrict 192.168.3.0 mask 255.255.255.0 server 127.127.1.0 fudge 127.127.1.0 stratum 8
restrict 192.168.3.0 mask 255.255.255.0 is the network segment and subnet mask of ceph1.
- Create an NTP file on ceph2, ceph3, and all client nodes.
- Open the file.
1vi /etc/ntp.conf - Press i to enter the insert mode and add the following content:
1server 192.168.3.166
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the file.
- Install NTP on all server and client nodes.
- Start the NTP service.
- Start the NTP service on ceph1 and confirm that the service status is active.
1 2 3
systemctl start ntpd systemctl enable ntpd systemctl status ntpd

Five minutes after the NTP process is started on ceph1, synchronize the time on other nodes. Otherwise, an error stating "no server suitable for synchronization found" is reported.
- Run the following command on all nodes except ceph1 to forcibly synchronize the NTP server (ceph1) time to all the other nodes:
1ntpdate ceph1If the synchronization is successful on other nodes, the following information is displayed:
15 Oct 14:43:39 ntpdate[32973]: adjust time server 192.168.3.166 offset -0.000034 sec
- Write the hardware clock to all nodes except ceph1 to prevent configuration failures after the restart.
1hwclock -w - Install and start the crontab tool on all nodes except ceph1.
1 2 3 4
yum install -y crontabs chkconfig crond on systemctl start crond crontab -e
- Add the following information so that all nodes except ceph1 can automatically synchronize time with ceph1 every 10 minutes:
1*/10 * * * * /usr/sbin/ntpdate 192.168.3.166
The IP address is the public network IP address of ceph1.
- Start the NTP service on ceph1 and confirm that the service status is active.
Parent topic: Configuring the System