Linux Cluster clock issues

Source: Internet
Author: User
Tags local time

First, the difference between NTPD and ntpdate:

Excerpt from: The difference between ntpd and ntpdate-baccarat-Blog Park http://www.cnblogs.com/liuyou/archive/2012/07/29/2614330.html1. Difference: NTPD is the time to adjust, Calibration of the time 1.1 points, and finally the time to correct the right; Ntpdate is the calibration time, that is, the direct adjustment time, does not consider other programs, the direct result is the clock jump.     2. Consequences of clock transitions many applications rely on a continuous clock, i.e. the time obtained is linear, based on the fact that time does not jump back. But the Ntpdate calibration time is the so-called "jump": After acquiring a time, Ntpdate uses Settimeofday (2) to set the system time,Here are a few very obvious questions:        First, this is not safe. Ntpdate's settings depend on the security of the NTP server, where an attacker can exploit some software design flaws, take down the NTP server, and perform some expendable tasks on the server that it synchronizes with. Since Ntpdate is in the same way as skipping, the server that follows it cannot know if an exception occurred (the only way to do this is by server).         Second, this is not accurate. Once the NTP server goes down, the server that follows it will not be able to synchronize time. Unlike this, the NTPD is not only able to calibrate the computer's time, but also to calibrate the computer's clock.         Third, this is not elegant enough. Because it is a jump, rather than making time faster or slower, a timing-dependent program can go wrong (for example, if Ntpdate finds your time is fast, it can go through two identical moments, which is fatal for some applications).         Thus, the only point at which time can be skipped is when the computer has just started but has not started many services. The rest of the time, it is desirable to use NTPD to calibrate the clock instead of adjusting the time on the computer clock.        NTPD during the synchronization with the time server, will the BIOS timer oscillation frequency deviation?? or the natural drift of Local Clock (drift)?? Record them. This way, even if there is a problem with the network, the machine can still maintain a fairly accurate walk. 3. Conclusion: Careful use of ntpdate!!!    Second, Linux cluster clock synchronization of a scenario scenario: a local assumption of an NTP server, used to calibrate the entire cluster of clocks. The experimental environment of this article: CentOS 6.6, 64-bit version (if the reader is using the Ubuntu machine, you can refer to the following reference URL) The experimental steps are recorded as follows: First, the time to calibrate the NTP server: 1. Select a machine as the NTP server, set the time zone: # date                  can check the current system time before operation # tzselect  Select 5 Asia, 13 Hong Kong, then follow the prompts to confirm the save.  # cp/usr/share/zoneinfo/asia/shanghai/etc/localtime &NBsp     #覆盖默认时区2. Calibrate Network time:     # ntpdate cn.pool.ntp.org3. Write the current time to the hard disk to ensure that the restart is valid: # hwclock-w  Then, install, configure, and start the NTP service and use its local time as a clock feed to ensure that the clock calibration service is still available when the cluster is disconnected 1. Installing the NTP service (two components ntpd and nptdate automatically installed) # Yum-y Install NTP2. Modify the configuration file #vim/etc/ntp.conf add it later:

Server 127.127.1.0

Fudge 127.127.1.0 Stratum 10

Note: If the cluster is in a closed LAN, you can block out the default server and comment out the following lines

#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. Configure client Authorization: Set the machine in the specified network segment to have access to the NTP server: Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap Note: Machines within the local 192.168.1.x network segment can query and synchronize time notes on this server:

[Restrict] parameter setting method:

The main parameters of parameter are:
Ignore deny all types of NTP connections
Nomodify client cannot use NTPC and NTPQ to modify the server's time parameters
Noquery clients cannot use NTPQ, NTPC, and other instructions to query the server time, which is equal to not providing NTP network school
Notrap does not provide the ability to trap this remote time login
Notrust rejecting clients that are not authenticated
Nopeer does not synchronize time with other NTP servers on the same layer

4. Set the NTP client: on all NTP clients, set the time zone consistent with the NTP server, refer to the previous action, and then modify the configuration file: # vim/etc/ntp.conf Add: Server xxx.xxx.xxx.xxx (XXX). . That is, the IP of the NTP server 5. Synchronize time on all machines, ensure consistent with NTP server # ntpdate NTP server address 6, start NTP Service # service NTPD start reference: Hadoop cluster time synchronization under Linux system-programming china Community http://www.hello-code.com/group/Hadoop/201407/1291.html Configuring NTP service ntpd/ntp.conf (for a Hadoop cluster)-Laurence Technology Blog- Blog Channel-Csdn.net http://blog.csdn.net/bluishglc/article/details/41413031

Linux Cluster clock issues

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.