How to configure Time Synchronization for foreign servers in CentOS

Source: Internet
Author: User

How to configure Time Synchronization for foreign servers in CentOS

Since the company's games need to be launched in Vietnam and South Korea, the time in Vietnam is one hour slower than ours, and the time in South Korea is one hour faster than ours, therefore, when configuring the system environment on the server, you need to set the time point for the Vietnamese server to synchronize with the Vietnamese server. The time point for the Korean server to synchronize with the Korean server is as follows:

1. Set the time synchronization for Vietnamese servers:

Cat>/var/spool/cron/root <EOF
*/30 */usr/sbin/ntpdate nt1_cs. mu. OZ. AU>/dev/null 2> & 1
EOF

Service crond restart

/Bin/rm-f/etc/localtime

Cp/usr/share/zoneinfo/Asia/Saigon/etc/localtime

Cat>/etc/sysconfig/clock <EOF
ZONE = "Asia/Saigon"
UTC = false
ARC = false
EOF

Cat>/etc/ntp. conf <EOF
Server cn.pool.ntp.org prefer
Server 210.72.145.44
Server cn.pool.ntp.org
Server ntp1.cs. mu. OZ. AU
Server ntw.cs. mu. OZ. AU
Server ntp.alaska.edu
Driftfile/var/lib/ntp. drift
EOF

Ntpdate cn.pool.ntp.org
/Sbin/hwclock-w

2. Set Korean server time synchronization:

Cat>/var/spool/cron/root <EOF
*/30 */usr/sbin/ntpdate nt1_cs. mu. OZ. AU>/dev/null 2> & 1
EOF

Service crond restart

/Bin/rm-f/etc/localtime

Cp/usr/share/zoneinfo/Asia/Seoul/etc/localtime

Cat>/etc/sysconfig/clock <EOF
ZONE = "Asia/Seoul"
UTC = false
ARC = false
EOF

Cat>/etc/ntp. conf <EOF
Server cn.pool.ntp.org prefer
Server 210.72.145.44
Server cn.pool.ntp.org
Server ntp1.cs. mu. OZ. AU
Server ntw.cs. mu. OZ. AU
Server ntp.alaska.edu
Driftfile/var/lib/ntp. drift
EOF

Ntpdate cn.pool.ntp.org
/Sbin/hwclock-w

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.