Is production: true
#migrated #ntp

Title: How to sync time in Linux

Created: 17 Mar 2023 Modified: 17 Mar 2023

Description:



[Link]

[Link2]

Instructions

  1. Install ntp

    # In ubuntu
    apt-get install ntp
    
    #In centos
    yum install ntp
    
  2. Setup ntp server

    #Edit server configuration
    sudo vim /etc/ntp.conf
    
    ====
    #Replace the {jp} to the country or replace the whole ntp server url
    pool 0.{jp}.pool.ntp.org iburst
    pool 1.{jp}.pool.ntp.org iburst
    pool 2.{jp}.pool.ntp.org iburst
    pool 3.{jp}.pool.ntp.org iburst
    ====
    
    #Restart server
    sudo service ntp status
    
  3. Verify

    #Install ntpstat
    sudo apt-get install ntpstat
    
    #Check ntp status
    ntpstat
    #synchronised to NTP server (133.243.238.243) at stratum 2
    #   time correct to within 19 ms
    #   polling server every 64 s