Thursday, June 19, 2014

NTP tips for hadoop cluster

Below is quick tips to setup NTP server and sync the whole hadoop cluster.

1. Configure hdm as the NTP server.

vi /etc/ntp.conf:
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

2. Configure others as NTP clients

vi /etc/ntp.conf:
server hdm.xxx.com

3. Start ntpd on all servers.

service ntpd start

4. Enable ntpd on all servers.

chkconfig ntpd on

5. Make sure NTP server has sycned with itself

ntpq -p

6. Check NTP clients

ntpdate -q hdm

7. Troubleshooting on NTP client

ntpdate -d hdm

8. Sample&Minimum /etc/ntp.conf

On server side:
driftfile /var/lib/ntp/drift
restrict 192.111.111.0 mask 255.255.255.0 nomodify notrap
restrict 127.0.0.1
restrict -6 ::1
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10
keys /etc/ntp/keys
On client side:
driftfile /var/lib/ntp/drift
server hdm.xxx.com prefer true iburst
keys /etc/ntp/keys

No comments:

Post a Comment

Popular Posts