1829103 Members
4842 Online
109986 Solutions
New Discussion

time server ?

 
SOLVED
Go to solution
Maaz
Valued Contributor

time server ?

Dear Experts
i m running multiple servers(NFS, Samba, Sendmail etc) all on redhat linux ES 4.0 and FC 2.
I want that All servers have same system time, i.e all servers should be client of one "time server", all servers get their/set their from "time server"
what should i do ?
any tutorial ?

Any help will be highly Appreciated

Regards
Maaz
8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: time server ?

Set up one machine with port 123 open.

Connect that server to a valid outside time server.

chkconfig ntpd on
service ntpd on

#may be xntp or ntp depending on distribution.

Have all other servers connect to this server in their ntp.conf files

You may need to manually adjust the time if the servers are too far off the norm, they will refuse to synch up.

For more: http://www.ntp.org

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
Ivan Ferreira
Honored Contributor

Re: time server ?

See this page for instructions about configuring NTP:

http://www.brandonhutchinson.com/Using_ntp_with_Red_Hat_Linux.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jan Pradac
Occasional Advisor

Re: time server ?

Hi,
nice tutorial can also be found here:

http://ntp.isc.org/bin/view/Support/WebHome
Rick Garland
Honored Contributor

Re: time server ?

As mentioned, Network Time Protocol (NTP) will be the answer.

http://www.siliconvalleyccie.com/linux-hn/ntp.htm
http://www.ntp.org

A couple of URLs to get you going.
Maaz
Valued Contributor

Re: time server ?

Dear Gurus... many thanks for really nice help/reply.
I am just going to read all those tutorials, and i will try to implement.
I'll be back in this thread if i found prblms in the implementations

Thanks
Regards
Maaz
Maaz
Valued Contributor

Re: time server ?

OS: rhel 4.
ntp server ip: 10.0.0.9/8

I have this ntp server, only connected to my lan, and not connected to internet. I want my other servers running rhel 3/4 get/synchronized their time from the 10.0.0.9(ntp server)

On ntp server /etc/ntp.conf
#less /etc/ntp.conf

restrict 127.0.0.1
restrict 10.0.0.0 mask 255.0.0.0 notrust nomodify notrap
server 10.0.0.9
server 127.127.1.0
fudge 127.127.1.0
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys

#service ntpd start
#netstat -nl |grep 123
Proto Recv-Q Send-Q LocalAd ForeignAd Stat
udp 0 0 10.0.0.9:123 0.0.0.0:*
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
udp 0 0 :::123 :::*

On Client Side
--------------
OS: rhel 4
#less /etc/ntp.conf
restrict default nomodify notrap noquery
restrict 127.0.0.1
restrict 10.0.0.9 mask 255.0.0.0 nomodify notrap noquery
server 127.127.1.0
fudge 127.127.1.0
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys

#service ntpd start
#netstat -nl |grep 123
Proto Recv-Q Send-Q LocalAd ForeignAd Stat
udp 0 0 10.0.0.1:123 0.0.0.0:*
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
udp 0 0 :::123 :::*

#ntpupdate -u 10.0.0.9
23 Nov 12:47:07 ntpdate[3028]: no server suitable for synchronization found

Plz help
Regards
Maaz
Ivan Ferreira
Honored Contributor

Re: time server ?

1- In the client, you should specify the ip of the server as ntp server:

server 10.0.0.9

2- You must run ntpdate before starting ntp

ntpupdate -u 10.0.0.9

3- Start the ntp services and verify the status using:

ntpq -p

On the server and the client. See:

http://docs.hp.com/en/B2355-90774/ch04s02.html#chbbcgeb

For a description of the output.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rick Garland
Honored Contributor

Re: time server ?

Here is an example of my ntp.conf file. I have removed all the comments from the file.
I am in CO so I am using timeservers based in
CO.

Here is a URL that will list public time servers you can connect to. Choose your location - best to choose a location that is close by.

http://ntp.isc.org/bin/view/Servers/WebHome


My ntp.conf file
=======================================
restrict default nomodify notrap noquery
# --- OUR TIMESERVERS -----
server tick.usnogps.navy.mil
server tock.usnogps.navy.mil
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
restrict 202.49.59.6 mask 255.255.255.255 nomodify notrap noquery
restrict 66.115.136.4 mask 255.255.255.255 nomodify notrap noquery
restrict 194.67.106.186 mask 255.255.255.255 nomodify notrap noquery
server ppoq3dc1.quantum.com # 10.50.2.234
restrict 10.50.2.226 mask 255.255.255.255 nomodify notrap noquery