How to use ntpd to setup and sync Hong Kong Time From Gov 2018

  1. First install NTP using: yum install -y ntpd (CentOS) or sudo apt install -y ntpd (Ubuntu)
  2. Edit the ntp config file.  Under CentOS it is /etc/ntp.conf

    1. Find the section where it shows:
      • 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
    2. Comment it out (Adding # at the beginning of each line):
      • # 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
    3. Add the following line (as of 10 Dec 2018 from pool.ntp.org).  No need to put # at the beginning.  For latest server list please go to: https://www.ntppool.org/zone/hk
      • server stdtime.gov.hk prefer
      • server 2.hk.pool.ntp.org
      • server 2.asia.pool.ntp.org
      • server 0.asia.pool.ntp.org
    4. Save the file and exit.
    5. Final output:
  3. Stop the service first: 
    1. systemctl stop ntpd.service
  4. After stopping the service, trigger the synchronization by typing: ntpd -gq to force the sync.  If success, it will take a while (few seconds) to do so.
  5. Check the time by typing: date
  6. Start the service again by typing: systemctl start ntpd.service

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services