Time synchronization problem

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
udy786
Posts: 35
Joined: 2014/04/29 15:43:51

Time synchronization problem

Post by udy786 » 2014/05/06 15:11:07

Hi,

I have two server with CentOS 5.5(32-bit) and 6.2(64-bit). On both server time zone is same and also time was same at configuration time. I have installed Asterisk on 5.5 CentOS and Apache and PHP on CentOS 6.2.

On both server time zone is same and everything configured same in time zone configuration. Problem is both server don't have same time. Some time its showing same time and some time difference going 5sec to 1min and automatically its coming same. When time difference coming then I am not able to use Asterisk so everything going stopped.

I am using date command to check time and I can see time difference. I have also tried with PHP code to see both server time. DB, PHP and Asterisk time. In every time, getting 5sec to 1min difference. Some time all showing same. Both server located on same location and connected in same switch. There is no delay to reach both server.

Any one please help me. Why have time difference if both server have same time zone.

udy786
Posts: 35
Joined: 2014/04/29 15:43:51

Re: Time time synchronization problem

Post by udy786 » 2014/05/06 15:14:23

I have tried to configure same time zone using tzselect command. Also I have tried to modify /usr/share/zoneinfo/$ZONEINFO but always getting same problem. Its working 1hrs or 2hrs without any time difference and after some difference coming and automatically working.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Time time synchronization problem

Post by gerald_clark » 2014/05/06 15:16:55

Both are badly in need of a 'yum update'.

stevemowbray
Posts: 480
Joined: 2012/06/26 14:20:47

Re: Time time synchronization problem

Post by stevemowbray » 2014/05/06 15:26:29

You can configure and run the NTP daemon ntpd to synchronise the time.

udy786
Posts: 35
Joined: 2014/04/29 15:43:51

Re: Time time synchronization problem

Post by udy786 » 2014/05/06 15:38:51

Hi stevemowbray,

Can you please guide me to run NTP?

udy786
Posts: 35
Joined: 2014/04/29 15:43:51

Re: Time time synchronization problem

Post by udy786 » 2014/05/06 15:40:16

Hi gerald_clark,

If I will run yum update then I think it will my OS (CentOS 5.5 to 6.5) that I can't do because my application Asterisk not supportable with latest CentOS version.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Time time synchronization problem

Post by gerald_clark » 2014/05/06 15:46:57

5.5 will only update to 5.10, not 6.5.
The system-config-date gui application will configure ntpd.

udy786
Posts: 35
Joined: 2014/04/29 15:43:51

Re: Time time synchronization problem

Post by udy786 » 2014/05/06 15:54:36

gerald_clark wrote:5.5 will only update to 5.10, not 6.5.
There is some limitation in application so I am not able to update my OS.
gerald_clark wrote: The system-config-date gui application will configure ntpd.
I have already used this command configured but still same....

User avatar
avij
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Time time synchronization problem

Post by avij » 2014/05/06 16:14:24

Try this on both:

Code: Select all

yum install ntp
service ntpd start
chkconfig ntpd on
Wait around 10 minutes, then run date to see if your clock is synchronized [yes, there are multiple ways to do this, but this is the easiest].

If you are already running ntpd, please provide the output of ntpq -pn

udy786
Posts: 35
Joined: 2014/04/29 15:43:51

Re: Time time synchronization problem

Post by udy786 » 2014/05/06 16:30:36

Hi avij,

I have ntp was installed on my server. Just I have started this service. Hope it will solve this problem. I will keep you posted my update.

Post Reply

Return to “CentOS 5 - Server Support”