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

Installing, Configuring, Troubleshooting server daemons such as Web and Mail

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

Postby 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!
huydq
 
Posts: 3
Joined: 2012/02/13 18:22:40

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

Postby 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.
gerald_clark
 
Posts: 7183
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

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

Postby 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 CentOS 5.7 Release Notes 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 VMware KB Article: Timekeeping best practices for Linux guests for more.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

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

Postby 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!
huydq
 
Posts: 3
Joined: 2012/02/13 18:22:40

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

Postby r_hartman » 2012/02/14 09:10:03

Sounds like a silly assignment, but have a look at date and ssh:
Code: Select all
man date
man ssh

Work out the rest yourself; should be easy now. Looks like Gerald hit the nail on the head.
r_hartman
 
Posts: 701
Joined: 2009/03/23 15:08:11
Location: Netherlands

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

Postby huydq » 2012/02/14 16:33:03

Thanks everybody. I installed, used htpdate and I synchronized time on 2 server.
huydq
 
Posts: 3
Joined: 2012/02/13 18:22:40

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

Postby r_hartman » 2012/02/15 17:38:01

Nice. Well done.
r_hartman
 
Posts: 701
Joined: 2009/03/23 15:08:11
Location: Netherlands

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

Postby AlanBartlett » 2012/02/15 20:27:49

For posterity (and on the OP's behalf), this thread is now marked [RESOLVED].
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk


Return to CentOS 5 - Server Support

Who is online

Users browsing this forum: No registered users and 0 guests