LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   clock synchronization (https://www.linuxquestions.org/questions/linux-general-1/clock-synchronization-27282/)

rasejo 08-05-2002 08:36 PM

clock synchronization
 
Hello,

how can i synchronize linux server clocks? It said that I need a time server, where can i get one? Is it possible to synchronize them without the time server?

Ionized 08-06-2002 12:15 AM

you can use NTP. It's available....somewhere, just look for it. You can then use
ntpdate ntp.server.whatever
to update your clock to the current time.

naz 08-06-2002 12:30 AM

You can use xntpd to keep all your linux server clocks synchronised, just slave all of them to one master server in your cluster - in turn, slave this "master" server to a public NTP server (your hosting provider or ISP should have one, if not just google for it)

naz

rasejo 08-06-2002 02:57 AM

thanks for your reply, naz and Ionized.
How can I make a master linux server.

Ionized 08-06-2002 12:10 PM

xntp (if I'm not misstaken) is used as a daemon to constantly update your clocks. I believe he's saying to use xntpd on the other linuc machines, use them to update from one "master" linux machine you have, and in turn have that "master" machine update from an external NTP source. There are many public ntp time servers out there, just search for them.

rasejo 08-07-2002 08:16 PM

thanks for the reply Ionized.

yes, i have found many ntp time servers. and i was able to update the time by ntpdate. i have also read that it was preferable to run the ntpdate once and a while than to run the xntp daemon. but doing this, i could not make a master server right?

rasejo 08-07-2002 08:19 PM

I also tried running the ntpd daemon, but i was not able to my client to the server running the daemon.

Ionized 08-07-2002 10:16 PM

Well, I've never setup a time server myself with ntp or xntp. It seems that linux is it's own server in itself, because I have used window's "net time" to set my windows clock from the linux server's.

rasejo 08-08-2002 08:17 PM

I just tried to schedule my linux to update its time using ntpdate and cron/at. but doesn't seems to work.

Ionized 08-08-2002 09:38 PM

Well, like I said, I've done time updates from a windows machine to a linux machine, but not linux->linux. I *think* ntp should work though...check to make sure your ports are open on your server computer (port 34 is Time, port 123 is NTP. I dunno if you need both or not...)

rasejo 08-08-2002 11:02 PM

ok thanks Ionized

mikek147 08-09-2002 04:50 AM

Depending on how big your network is, one way to handle the time synchronization across all your machines is to have one Linux box run ntpd. This will setup you box to periodically go out to the internet time servers and slowly slew the time on you box to the correct time. Then broadcast the time on the local net, acting as a local time server. The broadcasting of the time can cut down on network activity if you have allot of systems that need synchronization.

As far as using ntpdate, this does work. However, when correcting the time on the host, it makes the difference adjustment in one big jump. On some systems, this jump, forward or backward in time, may not be desirable.

To set yourself up to use ntpd, just add to /etc/ntp.conf:

server ntp2.cs.wisc.edu
server ntp.ucsd.edu
server ntp1.cs.wisc.edu

I use the above servers due to the short response time between them and my server. To set your system up as a broadcast server, make sure you have ntp-doc installed. ntp-doc has all the particulars on setting up ntpd. -mk

shogun1234 07-12-2007 06:53 PM

I have a question. Are there any way to synchronize clock without using NTP?

My problem is I need to run several machines simultaneously. Each machine has its own clock and they are different. I do not need to update the hardware clock. So what I need is the algorithm of obtaining the time stamp of each machine involved in the tasks and calculating the offset from the machine chosen as the standard time server. Then my programme is able to compensate the time stamp correctly.

Is there any open source software doing such kind of tasks without root privilege (I have no root privilege to the machines I need to perform my tasks)? Or I have to write the code myself?

I appreciate any suggestion. Thank you very much.


All times are GMT -5. The time now is 07:27 PM.