Follow

Customizing the time on a compute node

NTP Server

These steps will configure a compute node to use a remote NTP server as the time source:

  • Prerequisites:
    1. SSH into the compute node with username manager and the password that you set when registering the compute node.
    2. Run sudo su and retype the manager password to gain root access.
    3. Make a copy of the chrony.conf file before editing it:
      cp /etc/chrony.conf /home/manager/chrony.conf.original
  • Edit the chrony.conf file to use a remote NTP server:
    1. vi /etc/chrony.conf then type i to edit the file.
    2. Under "# Allow NTP client access from local network", enter:
      allow 10.1.2.3
      where "10.1.2.3" is the NTP server with which you want to sync. Alternatively, you can use the FQDN of the NTP server, and then add an entry for the IP and FQDN of the NTP server in /etc/hosts.
    3. Comment out the lines under "# Listen for commands only on localhost." by adding # before the line:
      #bindcmdaddress 127.0.0.1
      #bindcmdaddress ::1
    4. Under "# Use public servers from the pool.ntp.org project. / # Please consider joining the pool (http://www.pool.ntp.org/join.html).":
      • Comment out all the servers listed by adding # before the 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
      • Add line:
            server 10.1.2.3 iburst
            where "10.1.2.3" is the NTP server with which you want to sync. Alternatively, you can use the FQDN of the NTP server, and then add an entry for the IP and FQDN of the NTP server in /etc/hosts.
    5. Save changes and exit chrony.conf by typing ESC :wq
  • Setting the time zone:
    1. To list time zone options, run: timedatectl list-timezones
    2. Set the time zone as needed: timedatectl set-timezone region/time_zone
      where "region/time_zone" is the desired time zone (for example, America/New_York)
      • For example, real time is 9:00am EDT (8:00am CDT). Time on the NTP server is 8:10am CDT, and the required compute node time zone is EDT. After setting the time zone on the compute node to America/New_York and completing the other steps in this article, the compute node's time will be 9:10am EDT.
  • Configure the compute node to use NTP:
    1. Configure the compute node to use NTP: timedatectl set-ntp yes
    2. Restart services so the changes are implemented:
      • systemctl restart chronyd
      • systemctl restart systemd-timedated.service

 

Default Internet Time Server

These steps will set the time zone, using the default internet time servers instead of a remote NTP server:

  • To list time zone options, run: timedatectl list-timezones
  • Set the time zone as needed: timedatectl set-timezone region/time_zone
    where "region/time_zone" is the desired time zone (for example, America/New_York)
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments