1753503 Members
4738 Online
108794 Solutions
New Discussion юеВ

Configure NTP server

 
SOLVED
Go to solution
Rajesh Karelia
Frequent Advisor

Configure NTP server

Hi All,

I need to synchronize the time of 2 servers for MC Serviceguard. The requirement is that the machine shud synchronize their time with a TIME server in the organization.

The server is "time.tlp.co.uk"

Can someone pls explain the steps to configure this.

Thanks
Rajesh
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Configure NTP server

Shalom Rajeesh

modify the ntp.conf file in /etc

Put the server in as indicated.

Make sure port 123 is open and time services work to and fron that server.

set system time carefully on both systems to within a few minutes of the actual time.

/sbin/init.d/ntpd start

It may be xntpd, I don't have a system handy.

ntpq -p

This will show a good connection.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
nanan
Trusted Contributor
Solution

Re: Configure NTP server

Hi
Reflect the Time server at /etc/ntp.conf
like this

server time.tlp.co.uk version 3

and then excute /sbin/init.d/xntpd start
and check with "ntpq -p" command

Regards
nanan
Robert-Jan Goossens
Honored Contributor

Re: Configure NTP server

rariasn
Honored Contributor

Re: Configure NTP server

Hi Rajesh Karelia,

Sample "/etc/ntp.conf" in both servers.

peer node1 version 3
peer node2 version 3
trustedkey 15
server time.tlp.co.uk version 3 prefer

Verify permissions of ntp.conf file,

-rw------- 1 bin bin 18972 Jan 13 2004 /etc/ntp.conf


# /sbin/init.d/xntpd stop
# /sbin/init.d/xntpd start


rgs,

ran

Bill Hassell
Honored Contributor

Re: Configure NTP server

You can replace the entire /etc/ntp.conf file with this:

server time.tlp.co.uk

But before you start, you must verify that your network adminsitrator has not disabled access to external NTP servers. Use this command:

ntpq -p time.tlp.co.uk

Now this server does not have an Internet IP address defined in DNS so I assume that your local DNS server can find it. Use this command:

nslookup time.tlp.co.uk

If that does not work on your machine, the NTP server name is incorrect.

It is very important to have multiple servers available for reliability. While NTP will keep the time within 128ms of atomic time, public timeservers go offline once in a whiloe. The NTP protocol is most reliable when there are 3 or more servers. I would suggest this for your ntp.conf file:

server 0.europe.pool.ntp.org
server 1.europe.pool.ntp.org
server 2.europe.pool.ntp.org
driftfile /etc/ntp.drift

That's all you need in ntp.conf. NTP will take care of details like version and the "prefer" option is not recommended for general usage.

Now verify that these servers can be reached:

ntpq -p

(reads your ntp.conf file and reports on status)

Now if this fails, you'll need to see if the hostname(s) fail which means DNS problems, or the server is not reachable which means firewall problems.

Once ntpq -p is working, edit the file /etc/rc.config.d/netdaemons and change these 2 lines:

export NTPDATE_SERVER=0.europe.pool.ntp.org
export XNTPD=1

Now you are ready to use NTP. Since these machines are production machines, DO NOT run
/sbin/init.d/xntpd to start the service as this will 'jump' the time. For many applications (and cron), losing or gaining time can be a problem. Insteaqd, verify that your system is within about 5 minutes of accurate time. If so, run this command:

ntpdate -B 0.europe.pool.ntp.org

which will slowly adjust the time. Figure about 20 minutes for every 1 minute of adjustment. Anything over about 10-15 minutes cannot be 'slewed' (slowly adjusted) so you'll have to change the time manually (using date) when the applications have been shutdown -- or, the adjustment will be made as soon as the system is rebooted.

Once the time is accurate to less than a minute, you can manually start xntpd. Just run the command:

xntpd

Then periodically check the progress of xntpd with ntpq -p. Also look at syslog to see if anything other than adjustment messages are recorded. And that's it. Once NTP is running, you'll not need to do anything except watch for error messages in syslog.


Bill Hassell, sysadmin