Sell Downloads
Downloading...
Top articles and links related to Tradebit:

Converting files

Affiliate program



Top Sellers on Tradebit

Games Charts
Free Game Trials to download

Sound Effects
One of the largest sound collections on the planet!

Service Manual
Our huge PDF manual collection has more than 30,000 files for your car, bike or electronic device.



Setting server time with ntp

Tradebit today runs on a self-made Linux “cluster” with 12 nodes. Some serve MySQL databases, some do web servers and others are for storage. For us it is very important, that all these servers have the same server time. Especially for the sales stats and other logging functionality.

Over time, if you do not keep your time in sync on all boxes, the time of the servers starts to differ in minutes and the longer you let it run… it can become hours.

On Linux there is a nice tool, which should be already installed on your servers:

ntpdate

which fetches the actual date and time from servers, which are synced by radio or satellite controlled clocks. To set your hardware clock with this command, you can log in to your machine and start:

/usr/sbin/ntpdate ntp5.tamu.edu

where “ntp5.tamu.edu” is a time server in Houston, TX. You should pick your own time server close to you… Google for “ntp time server list” to get actual lists.

The command above does not set the hardware clock yet. Expand the command with the second command “hwclock” and write output to /dev/null in a script:

/usr/sbin/ntpdate ntp5.tamu.edu 2>/dev/null >/dev/null && hwclock -w 2>/dev/null

fetches the date and sets the hardware clock on linux to the actual time.

The same tool is also available for Windows!

del.icio.us Facebook StumbleUpon

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image