The correct setting of the server's clock and time zone is essential to ensure the normal operation of the distributed system and maintain accurate log timestamps. This tutorial will show you how to configure NTP time synchronization and set the time zone on an Ubuntu 14.04 server.
To complete this tutorial, you need to have an Ubuntu server with a non-root account that can use the sudo
command, and the firewall is turned on. Students who don’t have a server can buy from here, but I personally recommend you to use the free Tencent Cloud Developer Lab for experimentation, and then buy server.
timedatectl list-timezones
Be sure to replace desired_timezone with the time zone you choose from the list:
sudo timedatectl set-timezone desired_timezone
For example, to set the time zone to New York, use the following command:
sudo timedatectl set-timezone America/New_York
timedatectl
Local time: Fri 2016-03-2512:00:43 EDT
Universal time: Fri 2016-03-2516:00:43 UTC
Timezone: America/New_York(EDT,-0400)...
sudo apt-get update
sudo apt-get install ntp
After the NTP package is installed, your server will enable NTP synchronization!
To learn more about setting time zone and NTP synchronization related tutorials, please go to Tencent Cloud+Community to learn more.
Reference: "How To Set Up Timezone and NTP Synchronization on Ubuntu 14.04 [Quickstart]"
Recommended Posts