CentOS7+CDH5.14.0安装全流程记录,图文详解全程实测-4配置NTP服务

配置NTP服务。标准的做法是配置NTP服务器,但是这里为了方便就用简化的方式配置了。

这个在安装初期,不是必须的,只要保证各机器的时间同步就行,使用如下命令可以查看时间是否同步:

[root@cdh1 ~]# date;ssh cdh2 date;
2019年 04月 12日 星期五 16:19:58 CST
2019年 04月 12日 星期五 16:19:59 CST

时间差1-2秒钟就没事。

 确保每台机器的ntpd服务都是启动状态,否则后面CDH安装完成后,主机状态会是错误状态。

systemctl start ntpd.service

systemctl status ntpd.service

设置开机自动启动:

systemctl enable ntpd.service

CentOS7+CDH5.14.0安装全流程记录,图文详解全程实测-4配置NTP服务


1.执行命令,修改配置。

vim /etc/ntp.conf
            我修改的配置如下,注意第一行配置根据自己centos的网关来配置。

restrict 192.168.9.0 mask 255.255.255.0 nomodify notrap 

# Use public servers from the pool.ntp.org project.

# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst



server 127.127.1.0

fudge 127.127.1.0 stratum 10
            

2.执行命令

vim /etc/sysconfig/ntpd
            增加一行:

            SYNC_HWCLOCK=yes

 3.重启ntp服务

systemctl restart ntpd.service

systemctl status ntpd.service