CDH时间不同步问题,ntp服务器搭建


CDH时间不同步问题,ntp服务器搭建:

hadoop集群中配置ntp时间同步服务器


1、首先cdh centos默认时间同步使用的是chronyd服务,先关闭:

systemctl stop chronyd

  

2、时间服务器配置(必须root用户):

1 检查ntp服务是否安装
2 [root@hadoop102 桌面]# rpm -qa|grep ntp
3 ntp-4.2.6p5-10.el6.centos.x86_64

 

3、找到其中一台作为修改ntp配置文件:

 1 [root@node0 ]# vi /etc/ntp.conf
 2 修改内容如下
 3 #将下面原有的四行注释掉
 4 #server 0.centos.pool.ntp.org iburst
 5 #server 1.centos.pool.ntp.org iburst
 6 #server 2.centos.pool.ntp.org iburst
 7 #server 3.centos.pool.ntp.org iburst
 8 #联网的情况添加以下所有内容
 9 server 0.cn.pool.ntp.org iburst
10 server 1.cn.pool.ntp.org iburst
11 server 2.cn.pool.ntp.org iburst
12 server 3.cn.pool.ntp.org iburst
13 #没有联网只需添加以下两条即可,这个即可
14 server 127.127.1.0
15 fudge 127.127.1.0 stratum 10

 

4、修改/etc/sysconfig/ntpd 文件

1 [root@hadoop102 桌面]# vim /etc/sysconfig/ntpd
2 增加内容如下
3 SYNC_HWCLOCK=yes

5、重启ntpd服务

1 systemctl restart ntpddate
2 检查:
3 [root@node1 ]# ntpq –p
4 remote refid st t when poll reach delay offset jitter
5 ==============================================================================
6 *LOCAL(0) .LOCL. 10 l 45 64 377 0.000 0.000 0.000

 

6、其他机器配置(必须 root 用户) :

a).修改配置文件:
    [root@node1 ]# vi /etc/ntp.conf
    添加下面1条即可:
    server node0 iburst
b).重启ntpd服务
    [root@node1 ]# systemctl restart ntpddate

c).检查:
    [root@node1 ]# ntpq –p
    remote refid st t when poll reach delay offset jitter
    ==============================================================================
    node0 LOCAL(0) 11 u 1 64 1 0.597 -0.185 0.000


d).配置定时任务 10 分钟与时间服务器同步一次
    [root@node1]# crontab -e
    */10 * * * * /usr/sbin/ntpdate hadoop102

 

奇怪的是,服务器时间同步了,ntp服务正常。 cdh的还是报红,百度了一下,有人说要等上几小时,让cdh服务自动切换至ntp服务。

那么下面就等待一段时间看看吧

 from 2020-05-12 13:07

。。。。。。。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM