NTP: Synchronize time using other NTP peers

Share this link

If you didn’t already set up a time server, learn how to configure a NTP server.

Install the NTP package:

# yum install -y ntpd

Edit the /etc/ntp.conf file and comment the following lines if you don’t want to use the default timeservers:

#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org

In the same file, add the name (or IP address) of your time server:

server timeserver

Check the system date:

# date

If the system date is more than 15 minutes away from real time, set up the date from your time server:

# ntpdate timeserver

Activate the NTP service:

# chkconfig ntpd on

Start the NTP service:

# service ntpd start

Check that the service is working properly:

# ntpq -p
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
2 comments on “NTP: Synchronize time using other NTP peers
  1. ansuya says:

    Hello,

    I applied this configuration of NTP in my RHCSA exam.
    But in RHCE exam requirements we are asking for “peers sychronizing”.
    Where is the peer sychronizing in your post?
    The line in ntpd.conf, like this:
    #####
    peer address
    #####

    Can you explain clearly difference of this 2 directives:
    peer address
    ## and
    server address

    • CertDepot says:

      Normally with NTP, each client should connect to at least 3 servers with the server directive to get the best results and reliability.
      In addition, each client can also connect to peers, other clients located at the same level (NTP uses the term stratus) to improve the quality of the computed time.
      Simple clients don’t need to set up the peer directive except in very special cases (bandwidth requirement, etc).
      I don’t know why the term peers is even mentioned. From my understanding you should only consider the server directive whatever they say or write.

Leave a Reply

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create an EXT4 file system mounted by UUID in /etc/fstab under /vol based on a logical volume of 28 logical extents.

RHCE7: Task of the day

Allowed time: 10 minutes.
Change the SSH process configuration to only listen on the 443 port.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...