I wanted to know which should be the best way to sync time for a linux machine. We have an application server and a database server, both using RHEL 5.8 as the OS. It is important that the time on both these servers match together and also sync with a common time source. As per my knowledge, these are the 2 ways which can be explained as follows considering the common source as instructor.example.com, it can also be assumed that desktop1.example.com & desktop2.example.com are the hostnames of the other 2 machines
1) Add a cron job with the command, ntpdate to sync with the time on instructor.example.com. The cron job could be scheduled once a day something as follows:
2) Configure the /etc/ntp.conf on the 2 machines, desktop1.example.com & desktop2.example.com to include the line like:
Code:
server instructor.example.com
and line
Code:
peer desktop1.example.com
for desktop2.example.com and vice-versa for desktop1.example.com.
There are few observations in this also:
1) By adding server 0.rhel.pool.ntp.org, it should be aligning the time with public time server but would it be reliable?
2) By including the peer, should it help maintaining the time for desktop1.example.com & desktop2.example.com to be close to each other. This would mean that the 3 machines in picture including the server would have a time close to each other.
I had put this query in another forum but I have not got any replies from that.
I hope my question is clear.
Please revert with the reply to my query.
Regards
---------- Post updated 10-01-13 at 12:03 AM ---------- Previous update was 09-30-13 at 01:29 AM ----------
Request people in this forum to please revert.
Regards
Last edited by Scrutinizer; 10-01-2013 at 04:11 AM..
Reason: ct
I'm not commenting on your approach in general. But, if you are in an area that observes daylight savings time shifts or the server you're connecting to as a time server is in an area that observes daylight savings time shifts, NEVER use 1am or 2am or anytime between 1am and 2am as the time to kick off a cron job to synchronize times.
Don't bother with the peer line, just let the two servers sync to a reliable common time source, using the same ntp.conf. There are many examples in the documentation how to set this up. If the local clock of the servers is too far off, then initially servers will have trouble syncing, that is why usually when a server boots the ntpd start script first performs an ntpdate to leap to the right time before ntpd takes over. Once the server's time is in sync with ntpd there should be no need for any further ntpdate commands..
Thanks for your answer. I had 2 points to put fo which I would request elaborate & detailed answers:
1) Are the public servers as put by me a reliable source? Also, I am located in India, so which public server should be ideal as a time source.
2) Is the peer command going to help by having the 3 machines in picture including the server have a time close to each other?
Regards
---------- Post updated at 09:16 AM ---------- Previous update was at 09:12 AM ----------
Thanks for your answer but may I request you to please give a detailed &
elaborate answer on what should be the ideal configuration with the scenario given by me in mind.
Hello,
We have Windows 10 machine connected to Sparc T5440 server via serial cable.
We access the server from the Windows 10 machine using putty via serial connection. This allows us to access ILOM and Unix.
We have recently noticed that whenever we reboot the windows machine (Windows 10),... (11 Replies)
Hi
I have a requirement to rsync from remote to local machine via ssh and sync files that are changed in last n hours.
pgrep to check if no other sync is running
pgrep -f rsync.*/opt > /dev/null || rsync --bwlimit=10000 -avz --delete root@X.X.X.X:/var/source/ /opt/dest/ >> /home/log 2>&1... (0 Replies)
Hi All,
I deployed the rhel7 server in the bare metal hardware. I want to configure the rhel7 server to sync time with bios. I tired the below commands. Still it did not sync the time with bios.
Thanks,
Kalai (3 Replies)
Hi folks, I have developed a Linux server for my customer. After migrating the server to my customer site, I was trying to sync its time to the NTP time servers at my customer site.
Below is the ntp.conf:
% vi /etc/ntp.conf
# Permit time synchronization with our time source, but do not
# permit... (2 Replies)
Hi,
My Linux VMs are running on citrix XEN.Somehow the time drift is too high (going very fast). Even if the correct time configured using date -s command, for every 1 hr it is differing almost 5 - 10 mins.
Tried configuring ntpd (local NTP server) and still it is not synchronized.
Machine... (2 Replies)
Ok, I have 4 production systems. There is one NTP server for all four systems. In each system there is one Solaris 10 box that points to that NTP server. All of the other machines in the system point to the Solaris 10 machine to get their time sync.
All four Solaris 10 machines have essentially... (2 Replies)
Hi folks,
The server time is no tgetiing synched up with the NTP server.
I tried ntpdate -u <ipadress> this is not working. please help out.
regards,
Sag. (7 Replies)