How does CentOS7 modify the system time? OpenVZ sync timezone to NTP server

OnThe system time setting is wrong under Linux, how to modify the synchronization?

How does CentOS7 modify the system time? OpenVZ sync timezone to NTP server

The easiest way is to quickly configure OpenVZ to synchronize the time zone to the NTP server via SSH commands.

  • NTP English full name isNetwork Time Protocol.

What is OpenVZ?

  • OpenVZ is based onLinuxOS-level virtualization technology for the kernel.
  • OpenVZ allows physical servers to run multiple operating systems, a technology commonly used in virtual private servers.

First, delete the local time zone ▼

rm -rf /etc/localtime

Modify the time zone to +8 zone ▼

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

View time zone settings▼

date -R

How to modifyCentOS 7 system time?

Next, modify the CentOS 7 system time and set the OpenVZ synchronization time zone to the NTP server to synchronize with the time server.

Install NTP ▼

yum install -y ntp

Debug view time difference ▼

ntpdate -d us.pool.ntp.org

Sync time ▼

ntpdate us.pool.ntp.org

Check if the time is synchronized ▼

date -R

Modify NTP configuration file▼

vi /etc/sysconfig/ntpd

Synchronize the hardware clock of a standalone host ▼

SYNC_HWCLOCK=yes

Configure to start the NTP service at startup, and automatically synchronize the time on a regular basis▼

systemctl enable ntpd.service

Start NTP synchronization ▼

systemctl start ntpd.service

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "How does CentOS7 modify the system time? OpenVZ Synchronize Time Zone to NTP Server" to help you.

Welcome to share the link of this article:https://www.chenweiliang.com/cwl-1307.html

Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!

🔔 Be the first to get the valuable "ChatGPT Content Marketing AI Tool Usage Guide" in the channel top directory! 🌟
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!

 

Comment

Your email address will not be published. Required fields * Callout

scroll to top