Monday, February 21, 2022

[SOLVED] Ceph status do not respond when ntp is running

Issue

Command ceph status doesn't response if we put any servers in /etc/ntp.conf
I have 3 ceph nodes on centos 7 with this /etc/ntp.conf:

driftfile /vat/lib/ntp/drift

restrict 0.0.0.0 mask 0.0.0.0

server 0.ua.pool.ntp.org iburst
server 1.ua.pool.ntp.org iburst
server 2.ua.pool.ntp.org iburst
server 3.ua.pool.ntp.org iburst

includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor

and with this /etc/rc.local:

touch /var/lock/subsys/local
/sbin/iptables-restore < /etc/sysconfig/iptables
/sbin/ntpd -gq
/sbin/hwclock --systohc
systemctl enable ntpd.service
systemctl start ntpd.service

If I comment servers in /etc/ntp.conf:

#server 0.ua.pool.ntp.org iburst
#server 1.ua.pool.ntp.org iburst
#server 2.ua.pool.ntp.org iburst
#server 3.ua.pool.ntp.org iburst

then ceph becomes response. But with this answer:

health HEALTH_WARN
 clock skew detected on mon.node2, mon.node3
 Monitor clock skew detected
...

systemctl status ntpd.service show that service is active and running.

I really cant understand why ceph becomes unresponsable if we put servers in ntp.conf.
Please, help me.


Solution

I don't know why but it have happened because of command in ntpd -gq. This command updates your datatime from servers which you have written in ntp.conf and then stops.
I can't figure out why ceph fails after this command but when I changed it to:

 ntpdate 0.ua.pool.ntp.org

Ceph became work.



Answered By - Oleksandr
Answer Checked By - Clifford M. (WPSolving Volunteer)