配置NTP服务。标准的作法是配置NTP服务器,可是这里为了方便就用简化的方式配置了。html
这个在安装初期,不是必须的,只要保证各机器的时间同步就行,使用以下命令能够查看时间是否同步:vim
[root@cdh1 ~]# date;ssh cdh2 date; 2019年 04月 12日 星期五 16:19:58 CST 2019年 04月 12日 星期五 16:19:59 CST
时间差1-2秒钟就没事。centos
确保每台机器的ntpd服务都是启动状态,不然后面CDH安装完成后,主机状态会是错误状态。服务器
systemctl start ntpd.servicessh
systemctl status ntpd.serviceide
设置开机自动启动:spa
systemctl enable ntpd.servicerest
1.执行命令,修改配置。code
vim /etc/ntp.conf
我修改的配置以下,注意第一行配置根据本身centos的网关来配置。server
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