Page 1 of 1
Keeping time updated / sync
Posted:
Mon Feb 06, 2017 12:12 pm
by gequiros
hello guys, what's the best practice you guys do to keep your server synchronized with time ?
... adjust time server 129.250.35.250 offset 7.912779 sec
Cause, mine get lost near 10 seconds a week and since it is a multiserver.... every morning i have to wake up earlier and update it, so agents can log in
Suggestions will be appreciated !!!
Re: Keeping time updated / sync
Posted:
Mon Feb 06, 2017 12:19 pm
by mflorell
What kind of server hardware are you using?
Have you already set up and configured ntpd on all of your servers?
Re: Keeping time updated / sync
Posted:
Mon Feb 06, 2017 12:59 pm
by gequiros
Servers are DELL, dedicated ( of course )
* Dell c6100
* X5670 Inter CPUs
processor : 23
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU X5670 @ 2.93GHz
* 32gb DDR3
* SSD 240 GB
* Linux DB-Server 4.1.36-44-default #1 SMP PREEMPT Mon Dec 12 21:24:10 UTC 2016 (b1c0ac2) x86_64 x86_64 x86_64 GNU/Linux
* Dialer Solution install from Scratch, Vicibox 7.0.4
and i am running now every 6 hours the following:
service ntpd stop
/usr/sbin/ntpdate -B -p 4 -u -q 0.pool.ntp.org
service ntpd start
I may be wrong, but that provided me the less off set, it used to be up to 3 mins over a week, now it went down to less than 10 secs a week...
Re: Keeping time updated / sync
Posted:
Mon Feb 06, 2017 1:31 pm
by mflorell
How do you have ntpd configured?
We usually recommend setting your database server up as a master timing server, with the other servers in the cluster pointing to the master and the master only getting it's time from one of the ntp pool servers.
Re: Keeping time updated / sync
Posted:
Mon Feb 06, 2017 11:57 pm
by gequiros
Actually i got mine getting time from 0.pool.npt.org, all the 6 servers from there... and all at 5 mins diff each other
and i am doing that at least once every 6 hours
using an static IP to match / get time from or even random, i still get it off sync
Either way, the issue is, even if i only set time on database and all others get time from it, database still get off sync by 10 seconds every week (sometimes more)
For you, which is the most reliable way to keep it sync ? the one you use ?
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 12:13 am
by williamconley
gequiros wrote:Actually i got mine getting time from 0.pool.npt.org, all the 6 servers from there... and all at 5 mins diff each other
and i am doing that at least once every 6 hours
using an static IP to match / get time from or even random, i still get it off sync
Either way, the issue is, even if i only set time on database and all others get time from it, database still get off sync by 10 seconds every week (sometimes more)
For you, which is the most reliable way to keep it sync ? the one you use ?
1) use the proper settings for the ntp protocol. At no time after the first "time set" does this include "setting the time" again. Each time you do this, you delete all the sync data and syncing has to start again. Look up the ntp protocol and let the sync do its job without setting any more.
2) it is NOT important that the servers have the correct time. It IS important that they have the SAME time. So having one local server at your facility act as the Master is the best way to go. That one server would reach out to "the world" and get the correct time, and it would then share the correct time with the other servers in the cluster. There's an "iburst" protocol that allows the other servers to "trust" your primary server and sync quickly even after reboot.
3) I don't recommend "pool" based NTP as this is an attack vector for hackers. Try to find a government NTP site as close to your physical/ISP location as possible. And remember: having the exact time is not nearly as important as all servers having the same time. So an NTP server on the other side of the continent is fine. Being off by a quarter second makes no difference. And having several government servers spread out geographically means that an internet outage in one part of the country won't kill your NTP link, plus having more servers makes the correct time more likely (although, as I said, not very important).
4) The primary reason for external NTP is more of a "sanity check" to avoid your system becoming off by too much. Most NTP syncing will work as long as your system is not off by more than a minute or so, it'll squeeze your server back to the real time without damaging anything. But if your system manages to get off by 5 minutes or more, sync will fail and you'll need to set ... which should never happen, honestly, if sync is set up and you don't lose internet.
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 12:22 am
by gequiros
I am assuming that problem MAY BE, because i reboot DB server at 6am and all other servers at 6:05am
I guess that's where the issue may be, am i correct ?
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 12:32 am
by williamconley
1) The DB server MUST be up before the other servers are rebooted. Time the reboot of the DB. Add a few minutes for safety. Reboot the other servers when you are sure the DB server will already be "up".
2) Time sync would not be affected by overlapping reboots. Not if you use NTP.
3) Time sync should be to a local server on all but one server. As I said before (and as Matt suggested). This will keep all the servers in sync with each other, which is what really matters.
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 12:52 am
by gequiros
BTW, DB server reboot time is 10 mins before all other servers
Now my question based on the things you said before, how do i make my DB server or WEB server become a "time server" for my other servers ?
Thanks
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 12:55 am
by williamconley
It's already a time server if you installed with Vicibox. You just have to set the other servers to look to it's local IP instead of a pool ntp service.
And remember to thank Kumba for building NTP into the installation automagically.
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 1:01 am
by gequiros
You can ask MATT, if he check his INBOX, i have asked a couple of times for a paypal or a simple way where i can say occasionally thanks for the help and hard work, but they don't want to i guess
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 1:04 am
by gequiros
I tried already to sync and it says:
/usr/sbin/ntpdate -u 8.8.8.8 ( Of course let's assume that's my DB server IP Address )
7 Feb 01:03:39 ntpdate[1008]: no server suitable for synchronization found
I tried that, and i get that error
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 6:50 am
by mflorell
You shouldn't be rebooting your DB or web servers, they don't need it. We have clients with DB and web servers that have been running without a reboot for over 2 years with no issues.
As for sending us money, the easiest way is just to buy the manuals, even if you've already bought them before, it costs us nothing to fulfill and the proceeds are used to support the open-source project
http://www.vicidial.org/store.php
Re: Keeping time updated / sync
Posted:
Tue Feb 07, 2017 6:47 pm
by gequiros
I already purchase that...
well i just want to show some gratitude to you, for your time and hard effort here helping to answer me and pretty much everybody else
Most of the times even i am not facing a problem i just read, it is all about learning and one day, being able to help someone else
Thanks