ntpdate提示Server dropped: no data处理方式
hbase集群出现region server起不来的情况,查看日志显示:
regionserver.HRegionServer: Master rejected startup because clock is out of sync
Org.apache.hadoop……ClockOutOfSyncException: Server ***** has been rejected; Reported time is too far out of sync with the master. Time difference of 45182ms > max allowed of 30000ms
……
ntpstat命令结果显示ntpd服务已经启用了,但是没有成功同步上。
cat /etc/ntp.conf |egrep -v ‘^$|#’
查看到配置的上级时钟源IP
server 123.45.4.1
尝试手动同步服务器并启动debug模式查看问题:
ntpdate -u -d 123.45.4.1
结果显示:
transmit(123.45.4.1)
transmit(123.45.4.1)
transmit(123.45.4.1)
transmit(123.45.4.1)
transmit(123.45.4.1)
123.45.4.1: Server dropped: no data
……
18 May 16:17:03 ntpdate: no server suitable for synchronization found
于是我怀疑是否服务器挂了,但是可以ping通,登陆上级时钟源,检查了两边的配置文件都没有问题。考虑为防火墙问题。
之前hbase集群为了安全性考虑启用了一部分端口的限制,查看上级时钟源的123/udp端口:
nmap 123.45.4.1 -sU -p 123
查看到端口的状态是filtered,选择登陆上级时钟源服务器对hbase集群所在IP段开放123/udp端口。
#查看防火墙状态
service firewall status
#放通123/udp端口限制
firewall-cmd --permanent --add-rich-rule=‘rule family=“ipv4” source address=“123.45.4.0/24” port protocol=“udp” port=“123” accept’
#重新加载配置
firewall-cmd --reload
再次手动同步并写入硬件
ntpdate -u -d 123.45.4.1
hwclock -w