Achieve cluster-NTP Time Synchronization

Source: Internet
Author: User
Tags aliyun

Network Time Protocol (NTP, Network Time Protocol) is used to synchronize all of its client clock services. The NTP server synchronizes the clock of the local system with a public NTP server and then serves as a time host so that all clients on the local network can synchronize the clock.

The biggest benefit of clock synchronization is the data in the log files on the relevant system. If you use the central log host to centrally manage logs in the network, the log results will better reflect the real situation. In a network that synchronizes the clock, the centralized performance monitoring and service monitoring systems can reflect system information in real time, and the system administrator can quickly detect and solve system errors.

1. Configure the client

# Synchronize local and remote server time on one machine

//Install ntpdate

Yum install ntpdate

Ntpdate can be directly installed by rpm without any dependency

Rpm-IVH http://mirrors.aliyun.com/centos/7.5.1804/ OS /x86_64/Packages/ntpdate-4.2.6p5-28.el7.centos.x86_64.rpm

 

// Synchronize time with remote machines

# Ntpdate ntp1.aliyun.com 19 Oct 10:07:54 ntpdate [17142]: adjust time server 120.25.115.20 offset 0.026562 Sec

// The automatic synchronization time can be implemented when writing data.

# Echo "*/5 *****/usr/sbin/ntpdate ntp1.aliyun.com>/dev/null 2> & 1">/var/spool/cron/root

# Crontab-l

*/5 */usr/sbin/ntpdate ntp1.aliyun.com>/dev/null 2> & 1

2. Set NTP time for the server

# Synchronize the time in the Cluster

1. Install NTP

[[Email protected] ~] # Yum install NTP

2. Start the ntpd service

[[Email protected] ~] # Systemctl start ntpd

[[Email protected] ~] # Systemctl enable ntpd

3. Synchronize NTP time servers with other Intranet machines

[[Email protected] ~] # Yum install ntpdate-y

[[Email protected] ~] # Date-s '123'

[[Email protected] ~] # Ntpdate 172.16.1.61

[[Email protected] ~] # Date

Fri Oct 19 10:35:35 CST 2018

 

 

 

Achieve cluster-NTP Time Synchronization

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.