Synchronization time of ntp server deployment in Centos7

Source: Internet
Author: User
Tags new york time zone

Synchronization time of ntp server deployment in Centos7

View the time zone list: timedatectl list-timezones | grep Asia
Set China Time Zone: timedatectl set-timezone Asia/Shanghai. After the execution, the time is changed to Beijing time.
View Current Time: date
View Current Settings:
[Root @ localhost ~] # Timedatectl
Local time: Mon 2017-10-09 16:44:08 CST
Universal time: Mon 2017-10-09 08:44:08 UTC
RTC time: Mon 2017-10-09 08:44:08
Time zone: Asia/Shanghai (CST, + 0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/
If no system has an ntp server installed, you can install yum install ntp-y.
Edit the ntp configuration file vi/etc/ntp. conf (the log file is in/var/log/messages by default) and add the following server domain names. If the original configuration file does not exist
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

Systemctl restart ntpd
Systemctl enable ntpd

In this way, the server is configured almost, but to make the effect more obvious, I changed the server to the New York time zone, and the time zone of another linux client to be synchronized to the Africa time, as a result, ntpdate on the client is not synchronized after ntpdate, and later we found that the time must be synchronized within the same time zone. That is to say, the time zone on the server and client must be in the China time zone.

Check whether the ntp server configuration is successful.
On the server (ip: 10.0.3.66)
Use date-s 23:30:30 (the time can be changed at will, but it can be changed to a time different from the client's time), and then the date can be seen as 23:30:30.
On the client
After ntpdate 10.0.3.66 is executed, it turns to 23:30:30.

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.