[RESOLVED] How to synchronize time on 2 server CentOS (do not use NTP)

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
huydq
Posts: 3
Joined: 2012/02/13 18:22:40

[RESOLVED] How to synchronize time on 2 server CentOS (do not use NTP)

Post by huydq » 2012/02/13 18:28:08

Hi everybody.

I'm using CentOS 5.5 on VMware. Assume that I have two servers CentOS: one primary server (IP 192.168.10.10)

and one backup server (IP 192.168.10.20). Now I want to synchronize time on 2 servers and I was told not to use

NTP. I search on Internet and found 2 way as follow:

+) using rdate: on backup server, I use :

[root@localhost ~]# rdate -s 192.168.10.10

and the following error:

[root@localhost ~]# rdate: couldn't connect to host localhost: Connection refused.

+) using net time and also failure:

[root@localhost ~]# net time set 192.168.10.10 /set /y

Could not locate a time server. Try specifying a target host.

I don't understand why errors occur. Is there other way to synchronize time on 2 servers? Can you help me, please!

Thanks!

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

[RESOLVED] How to synchronize time on 2 server CentOS (do no

Post by gerald_clark » 2012/02/13 18:30:39

It sounds like you are asking us to do your homework assignment, and I don't do homework.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: How to synchronize time on 2 server CentOS (do not use NTP)

Post by pschaff » 2012/02/13 18:52:48

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Don't use obsolete/unsupported releases - 5.7 is the current release. See the [url=http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.7]CentOS 5.7 Release Notes[/url] for details. By not updating you are implicitly accepting that you will live with numerous bugs and security issues (and associated known exploits) that have subsequently been fixed.

Who told you not to use NTP and why not? Seems like an unnecessary restriction. On the other hand, if both servers are on VMware then the VMware Tools should keep the time synchronized. If having trouble with time drift try adding "divider=10" to the kernel line in /boot/grub/grub.conf. See the [url=http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427]VMware KB Article: Timekeeping best practices for Linux guests[/url] for more.

huydq
Posts: 3
Joined: 2012/02/13 18:22:40

Re: How to synchronize time on 2 server CentOS (do not use NTP)

Post by huydq » 2012/02/14 02:33:22

Hi!

I'm a student and practicing in a company. My management asked me to find out more about how to synchronize time between two servers do not use NTP. Perhaps he known NTP, so asked me to find out more. Because I'm a student internship, so I'm not configurated on server which are running. I changed time on 2 servers CentOS which run on VMWare and try to synchronize time between them but not success. Can anyone help me, please!

Thanks!

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: How to synchronize time on 2 server CentOS (do not use NTP)

Post by r_hartman » 2012/02/14 09:10:03

Sounds like a silly assignment, but have a look at date and ssh:
[code]man date
man ssh[/code]
Work out the rest yourself; should be easy now. Looks like [b]Gerald[/b] hit the nail on the head.

huydq
Posts: 3
Joined: 2012/02/13 18:22:40

Re: How to synchronize time on 2 server CentOS (do not use NTP)

Post by huydq » 2012/02/14 16:33:03

Thanks everybody. I installed, used htpdate and I synchronized time on 2 server.

r_hartman
Posts: 711
Joined: 2009/03/23 15:08:11
Location: Netherlands
Contact:

Re: How to synchronize time on 2 server CentOS (do not use NTP)

Post by r_hartman » 2012/02/15 17:38:01

Nice. Well done.

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: [RESOLVED] How to synchronize time on 2 server CentOS (do not use NTP)

Post by AlanBartlett » 2012/02/15 20:27:49

For posterity (and on the OP's behalf), this thread is now marked [RESOLVED].

Post Reply