"Cluster NTP is out of sync" Displayed During the OceanBase Cluster Startup
Symptom
The following message is displayed when the OceanBase cluster is started:
[ERROR] Cluster NTP is out of sync.
Key Process and Cause Analysis
This error is reported because the time difference between hosts in the OceanBase cluster exceeds 100 ms. Use the NTP service to synchronize the time.
Conclusion and Solution
- Disable the firewall.
systemctl stop firewalld systemctl disable firewalld systemctl status firewalld
- Install and configure the NTP service.
- Install NTP on all clusters and NTP client nodes.
1yum -y install ntp ntpdate

- Back up the existing configuration on all clusters and NTP client nodes.
1cd /etc && mv ntp.conf ntp.conf.bak
- Select a server as the NTP server node, and create and configure an NTP file on the server. In this example, the server whose IP address is 192.168.0.216 is the NTP server node.
- Create a file.
1vi /etc/ntp.conf - Press i to enter the insert mode and add the following content to the file as the NTP server:
1 2 3 4 5
restrict 127.0.0.1 restrict ::1 restrict 192.168.0.216 mask 255.255.255.0 server 127.127.1.0 fudge 127.127.1.0 stratum 8
In the preceding content, restrict 192.168.0.216 mask 255.255.255.0 indicates the network segment and mask of the NTP server.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create a file.
- Create NTP files on all other client nodes.
- Open the file.
1vi /etc/ntp.conf - Press i to enter the insert mode and add the following content to the file as the client node:
1server 192.168.0.216
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Install NTP on all clusters and NTP client nodes.
- Start and synchronize the NTP service.
- On the NTP server node whose IP address is 192.168.0.216, start the NTP service and view the service status.
1 2 3
systemctl start ntpd systemctl enable ntpd systemctl status ntpd

- Forcibly synchronize the time of the NTP server node whose IP address is 192.168.0.216 to all other NTP client nodes.
1ntpdate 192.168.0.216
- Write the hardware clock to all nodes except the 192.168.0.216 server node to prevent synchronization failure after the server is restarted.
1hwclock -w - Install and start the crontab tool on all nodes except the 192.168.0.216 server node.
1 2 3 4
yum install -y crontabs chkconfig crond on systemctl start crond crontab -e
Run the crontab -e command to open the crontab file of the current user for editing scheduled tasks.
- Add the following content to the crontab file to enable automatic time synchronization with the 192.168.0.216 server node every 10 minutes:
1*/10 * * * * /usr/sbin/ntpdate 192.168.0.216
- Press Esc, type :wq!, and press Enter to save the file and exit.
- On the NTP server node whose IP address is 192.168.0.216, start the NTP service and view the service status.
Parent topic: Troubleshooting