Simple NTP Setup On Your Linux Servers

The Network Time Protocol (NTP) runs over port 123 UDP at transport Layera and is used to synchronize a computer’s time with another computer- usually a centralized time server. Not all clocks run at exactly at same speed. After a long enough period, the time of one clock will either end up ahead or behind another, causing what's called a "time drift". This situation can lead to inconsistent time issues, especially on servers. Issues like wrong times in log files, for cron jobs, for servers resources or databases replicatation etc. The NTP server package are already available from official CentOS repositories and can be installed using the following command.


LinuxSuit ~#  yum install ntp

When the package is successfully installed it's time to configure the NTP server. NTP is configured and controlled via a control file called conveniently called "ntp.conf," and you can find it in /etc/ntp.conf directory. NTP configuration is usually comprised of two parts. First is list of servers for our NTP to sync time with and second is list of networks that are allowed to query our server for time synchronization . For first part, we are going to add a server list provided by www.pool.ntp.org. You can choose your Continent , then search for your Country and a list of NTP servers will be provided. Then you just need to copy+paste that list into the configuration file. It should look something like this


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

For 2nd part we are going to allow our local network to query our server and localhost to get full access to query or modify.


restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 127.0.0.1

We also can specify the drift file and the log file location in our configuration.


driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log

When the configuration is finished, save and close the configuration file, then restart the ntp service.


LinuxSuit ~# service ntp restart

That's basically it. Your NTP should be set up, ensuring that your server is synchronized with your regional time allowing you to avoid time-sensitive errors. Just in case you were wondering, ServerSuit does offer NTP already preconfigured to just add to your servers whenever you might need it. Not that it's hard to set up, but we got a whole set of software available, also preconfigured, so why not include NTP? 

That's it for this article. Our next one will cover disk performance monitoring, so look out for that in the near future!

Until next time! 

April 28 2016

Add or review comments

Please leave your comment

Existing comments

Comments 1


byrehoradeh60
com] Anti-HIV Drug Database - alphabetical by brand name. The teams work with federal agents and government prosecutors to help build cases against prolific counterfeiters. <a href=http://custom.buyonpaper.com/buy-papers.html>Buy Papers | Purchase Custom Essays, Term Papers, Research Papers</a> <a href=http://custom.buyonpaper.com/free-essay.html>Free Essays | Plagiarism Free Essay Writing - starting at $10/page</a> <a href=http://custom.buyonpaper.com/original-essay.html>Original Essay | Original Custom Essay Writing Service</a> <a href=http://custom.buyonpaper.com/lab-report.html>Lab Report | Custom Lab Report Writing Service - $10/page</a> Supplant cleaner sacks if they're 80 5 % full. Follow up Visits On all follow up visits, you simply sign in at the desk in the lobby and expect to wait no longer than 5 minutes for a qualified therapist to assist you to the treatment area. There is no need to wait for delivery for a long time as our Australian delivery centers are situated nearly in every city.

Get notified about new publications and product updates.
Please note we do not share information to anyone.