LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 02-13-2012, 12:19 PM   #1
huydq_bk
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
Question How to synchronize time on 2 server CentOS (do not use NTP)


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!
 
Old 02-13-2012, 02:23 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

You have 2 (two) options:
- htpdate , man htpdate, rpm
and my favorite
- ntpdate

but, I doubt you will have success in VMWare machines, because they are synced to HOST machine running VMWare (and which should have been NTP synced). VMWare guests cannot have different time/date than host machine (by my experience)

good luck
 
Old 02-14-2012, 02:56 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,248

Rep: Reputation: 394Reputation: 394Reputation: 394Reputation: 394
Another messy way is to set up keypairs and then run a script on primary that creates a keypair authenticated ssh session on backup and then uses date -s to set the time.
 
Old 02-14-2012, 10:37 AM   #4
huydq_bk
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank everybody. I used htpdate and I synchronized on 2 servers.
 
Old 02-14-2012, 12:00 PM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Great,

can you please mark the thread as solved if you find the solution appropriate (how- look my sign.)

Regards.
 
Old 02-14-2012, 12:07 PM   #6
huydq_bk
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ok. I has marked the thread as solved. Thanks lithos very much.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i synchronize my NTP cheesewizz Linux - Server 4 11-07-2008 05:54 AM
Synchronize all my server using same date and time packets Linux - Hardware 2 09-26-2008 02:05 AM
NTP Server giving central time instead of eastern time wjleon Linux - Networking 3 11-01-2007 04:04 PM
Time Synchronize or NTP Management gurl4sh25 Linux - Software 5 06-04-2007 03:39 PM
synchronize time between linux and XP server taiwf Linux - General 1 11-03-2005 09:52 PM


All times are GMT -5. The time now is 07:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration