Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use NTP to synchronize Hadoop clusters

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to use NTP to make Hadoop cluster achieve time synchronization, for this problem, this article describes the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.

The host's NTP service is not responding to clock skew requests. recommendations

This is a host health test that checks if a host's system clock is out of sync with its NTP server. This test checks that the absolute value of the host clock bias reported by the "ntpdc -c loopinfo" command is not too large. If the command fails or the host's NTP daemon is not running, the test returns a bad health.

If NTP is not used on the host, disable this check for hosts that use the following configuration options. Cloudera recommends using NTP to synchronize Hadoop clusters.

Failure of this health test may indicate a problem with the NTP service or configuration of the host.

This test can be configured using the Host Clock Deviation Threshold Host Configuration setting.

Time zone change: (East 8)

cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#reboot

Select Node1 as the clock synchronization server, and other nodes as clients to synchronize time to this node.

Install NTP

View Task crontab -l1.3 Clock Synchronization Build Clock Synchronization Server

Here, cdh2 node is selected as the clock synchronization server, and other nodes synchronize time to this node for clients.

Install ntp:

$ yum install ntp

Modify the configuration file/etc/ntp.conf on cdh2:

restrict default ignore //Default does not allow modification or query ntp, and does not receive special packets restrict 127.0.0.1 //Give all permissions to this machine restrict 192.168.56.0 mask 255.255.255.0 notrap nomodify //Give the machine on the local area network the permission to synchronize time server 192.168.56.121 # local clock driftfile /var/lib/ntp/drift fudge 127.127.1.0 stratum 10

Start ntp:

$ service ntpd start

Set boot boot:

$ chkconfig ntpd on

ntpq is used to monitor ntpd operations, use standard NTP Mode 6 control message patterns, and communicate with NTP servers.

ntpq -p queries NTP servers in the network, showing the relationship between the client and each server.

$ ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *LOCAL(1) .LOCL. 5 l 6 64 1 0.000 0.000 0.000

"* ": Responding NTP server and most accurate server.

"+": NTP server responding to this query request.

"blank": NTP servers that are not responding.

"remote": The name of the NTP server that responded to this request.

"ref": Name of the higher level server used by NTP servers.

"st": The level of the NTP server that is responding to the request.

"when": The number of seconds since the last successful request.

"poll": seconds of the clock interval for the current request.

"offset": The time offset, in milliseconds (ms), from the time source to which the host is synchronized via the NTP clock.

client's configuration

Do the following on the cdh3 and cdh4 nodes:

$ ntpdate cdh2

Ntpd usually takes about 5 minutes to synchronize when it starts, so when ntpd starts, it can't provide clock service normally, and the error "no server suitable for synchronization found" is reported. It takes five minutes to start.

If you want to schedule time calibration, you can use the crond service to schedule it.

00 1 * * * root /usr/sbin/ntpdate 192.168.56.121 >> /root/ntpdate.log 2>&1

At 1:00 a.m. every day, Linux automatically adjusts the network time.

About how to use NTP to make Hadoop cluster to achieve time synchronization questions to share here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 219

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report