[Hadoop] Third, the Cluster Time Synchronization

Time server configuration

  • Master01 time server configuration (it must be root)

  • Ntp modify the configuration file [] /etc/ntp.conf

# 修改1 授权192.168.1.0-192.168.1.255网段上的所有机器都可以从这台机器上查询和同步时间
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# 修改2 集群在局域网中,不使用其他互联网上的时间
#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

# 添加3 当该节点丢失网络连接,依然可以采用本地时间作为时间服务器为集群中的其他节点提供时间同步
server 127.127.1.0
fudge 127.127.1.0 stratum 10
  • Modify / etc / sysconfig / ntpd file
# 添加内容 让硬件时间与系统时间一起同步
SYNC_HWCLOCK=yes
  • Restart ntpd service

  • Set ntpd service boot
chkconfig ntpd on

Other Server Configuration

  • [Must be the root user to configure the other servers 10 minutes with a time server]

*/10 * * * * /usr/sbin/ntpdate master01

 

 

 

Published 20 original articles · won praise 0 · Views 166

Guess you like

Origin blog.csdn.net/leonia1996/article/details/104351492