Page 1 of 1

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

Posted: 2012/02/13 18:28:08
by huydq
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!

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

Posted: 2012/02/13 18:30:39
by gerald_clark
It sounds like you are asking us to do your homework assignment, and I don't do homework.

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

Posted: 2012/02/13 18:52:48
by pschaff
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.

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

Posted: 2012/02/14 02:33:22
by huydq
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!

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

Posted: 2012/02/14 09:10:03
by r_hartman
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.

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

Posted: 2012/02/14 16:33:03
by huydq
Thanks everybody. I installed, used htpdate and I synchronized time on 2 server.

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

Posted: 2012/02/15 17:38:01
by r_hartman
Nice. Well done.

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

Posted: 2012/02/15 20:27:49
by AlanBartlett
For posterity (and on the OP's behalf), this thread is now marked [RESOLVED].