Ceph中会自动校验存储节点之间的时间,若不同节点之间时差较大,会有告警,因此需要配置NTP,同步各节点间的时间,提高网络管理效率。
1 | yum -y install ntp ntpdate |
1 | cd /etc && mv ntp.conf ntp.conf.bak |
1 | vi /etc/ntp.conf
|
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”是ceph1的网段与掩码。
1 | vi /etc/ntp.conf
|
1 | server 192.168.3.166 |
1 2 3 | systemctl start ntpd systemctl enable ntpd systemctl status ntpd |
ceph1节点启动ntp进程5分钟后,再在其他节点进行时间同步,否则会报错(no server suitable for synchronization found)。
1 | ntpdate ceph1
|
在其他节点同步成功显示如下:
1 | 15 Oct 14:43:39 ntpdate[32973]: adjust time server 192.168.3.166 offset -0.000034 sec |
1 | hwclock -w
|
1 2 3 4 | yum install -y crontabs chkconfig crond on systemctl start crond crontab -e |
1 | */10 * * * * /usr/sbin/ntpdate 192.168.3.166 |
此IP地址为ceph1节点Public Network的IP地址。