Page 1 of 1

NTP Time Sync for Cluster

PostPosted: Wed Jan 16, 2013 6:04 pm
by Polareious
Vicibox 4.0.1 from ISO standard | VERSION: 2.6-382a BUILD: 121116-1410 | Asterisk 1.4.44-vici | 1 Db/Web Server 4 Telephony Servers | No Digium/Sangoma Hardware | No Extra Software After Installation

Greetings to all!! I am buckling down to resolve a time sync issue... between servers in the cluster. I currently have the all 4 telephony servers connected with conferences/phones/carrier plans all configured properly. I can make calls out, but only one of the telephony servers has the time synced properly (ALL 4 telephony servers have the exact same configuration for the NTP settings/firewall disabled). The way I have it set up is the main DB/Web server currently is used as an NTP server inside my network as well - this connects to the outside world and gets the time from 2 possible Stratum 1 servers
(I have the NTP conf as:
driftfile /var/lib/ntp/drift/ntp.drift
logfile /var/log/ntp
broadcastdelay 0.008
keys /etc/ntp.keys
trustedkey 1 3 5 7 9
requestkey 1

# Basics to allow us to start and provide time
server 127.127.1.x
fudge 127.127.1.x stratum 10
restrcit x.x.x.x nomodify
restrcit 127.127.1.X mask 255.255.x.0 nomodify notrap
restrict 7.7.x.x mask 255.255.x.0 nomodify notrap
restrict 7.7.x.x mask 255.255.x.0 nomodify notrap
restrict x.x.x.x nomodify notrap

### And here's our real servers to sync to
server x.x.x.x
server x.x.x.x
server x.x.x.x


My first server connects just fine, shows up with the same time under the Reports tab (after clicking the + sign and seeing the DB/PHP time and all other server times). But the other 3 shows the time the DB server rebooted last (the last time it reached out and touched the other 3's time)
What could possibly hold this up as is? I discussed with the bossman to buy a network NTP device (pretty cheap, acts as a local NTP Stratum 2 server) yet we need to suffice without it for now. Any possible ideas? I thought it had something to do with the authentication but from my understanding there is none set by default.. Any ideas would be much appreciated, Thank you!

Vicibox 4.0.1 from ISO standard | VERSION: 2.6-382a BUILD: 121116-1410 | Asterisk 1.4.44-vici | 1 Db/Web Server 4 Telephony Servers | No Digium/Sangoma Hardware | No Extra Software After Installation

Re: NTP Time Sync for Cluster

PostPosted: Wed Jan 16, 2013 6:58 pm
by karlb
Hi!

The way I have mine setup is the DB server runs ntpd. The rest sync to the db server only.

You'd want to delete or comment out any sync server other than your DB server in the servers connecting.

Also, add "iburst" to the end of the server line for a faster sync.

Example: (172.24.98.82 is my DB server)
Code: Select all
driftfile /var/lib/ntp/drift/ntp.drift
logfile /var/log/ntp
keys /etc/ntp.keys
trustedkey 1
requestkey 1

# Basics to allow us to start and provide time
server 127.127.1.0
fudge 127.127.1.0  stratum 10
restrict default nomodify notrap
restrict 127.127.1.0

### And here's our real servers to sync to
server 172.24.98.82 iburst



You can verify your server is connected to the DB server and syncing by running:
Code: Select all
ntpq -p


You will see a asterisk next to your DB server if it's synced. It CAN take a minute or two.

Re: NTP Time Sync for Cluster

PostPosted: Wed Jan 16, 2013 7:55 pm
by Polareious
Aye, I do have each poi ting to just the db server. It is just one telephony server in the cluster that is syncing time wise [viewable on the reports page and expanding the server list section] Could you post your client ntp.conf? I I have read quite a few articles and have the restrict in both server and local server for the network/subnet using mask as well I have tried commenting out the local ntp for the hardware clock to disable it possibly overriding the db server connection.. -_- from my understanding this problem may be a bit deeper than my current presumption.. None of the load statistics or usage levels come up for the 3 on the cluster. When I look at ntpq -p on all 4 telephony servers they are the connected to the db as well the config is too.

Re: NTP Time Sync for Cluster

PostPosted: Thu Jan 17, 2013 9:23 am
by Polareious
Image

Re: NTP Time Sync for Cluster

PostPosted: Thu Jan 17, 2013 2:05 pm
by Polareious
Could this possibly be a sql connection error? Or a socket in use error? I keep thinking it is something to do with the connection between the other 3 clusters and the main DB..

Re: NTP Time Sync for Cluster

PostPosted: Mon Jan 21, 2013 2:18 pm
by Polareious
Issue resolved!!! The other 3 servers for some reason did not correctly assign the passwords to the manager.conf as well the bind addr was set to 0.0.0.0 instead of 127.0.0.1. I edited to manager.conf for the 3 telephony servers not connected and placed the proper bindaddr and secret for the listencron/cron/etc to the main password for the DB. After I refreshed my reports page it now shows all servers time synced and connecting with each other 8)

Re: NTP Time Sync for Cluster

PostPosted: Tue Jan 22, 2013 5:04 am
by DomeDan
Good postback!
Strange that you manage to do the same thing on 3 servers, maybe there's some problem with the vicibox install script
if you got the logfile /var/log/vicibox.log check if there's any different between the telephony server that worked and one that didn't.

Re: NTP Time Sync for Cluster

PostPosted: Mon Feb 25, 2013 3:07 pm
by Polareious
Every cluster I have installed has had the issue with the manager.conf not having the current password instead of default (1234) - even when doing any svn updates, you must go back in and reset the manager.conf passwords for each server individually (even with setting the password on the web admin for that specific server and rebuilding the conf files)

Re: NTP Time Sync for Cluster

PostPosted: Mon Feb 25, 2013 4:45 pm
by williamconley
And yet we've never had this problem. Hm.

Re: NTP Time Sync for Cluster

PostPosted: Mon Feb 25, 2013 4:52 pm
by Polareious
I do not know what it is, for even during the custom install I set the passwords for the database connection during the expert install, yet it does not ask after it again after that - thus I assumed it would set but I did not set the manager.conf passwords on my second (of 8) telephony servers after the initial install. It kept coming up saying cannot connect to sendcron. Once I set the proper password in the manager.conf CLI cleared up and calls started running smoothly 8)

Re: NTP Time Sync for Cluster

PostPosted: Mon Feb 25, 2013 5:19 pm
by williamconley
The next time you do it, document the exact steps and solution and put it in the Vicidial Issue Tracker. Or post it in the Vicibox board as a note for Kumba (or both?). That will give someone in charge of that scenario a chance to look it over, and perhaps solve it and squish the bug. It's installer related, and I'm not entirely positive installer items are appropriate on the vicidial issue tracker or not. But a post in the installer board could find that out when Kumba answers.

Re: NTP Time Sync for Cluster

PostPosted: Wed Nov 14, 2018 10:44 am
by virtualsky
karlb wrote:Hi!

The way I have mine setup is the DB server runs ntpd. The rest sync to the db server only.

You'd want to delete or comment out any sync server other than your DB server in the servers connecting.

Also, add "iburst" to the end of the server line for a faster sync.

Example: (172.24.98.82 is my DB server)
Code: Select all
driftfile /var/lib/ntp/drift/ntp.drift
logfile /var/log/ntp
keys /etc/ntp.keys
trustedkey 1
requestkey 1

# Basics to allow us to start and provide time
server 127.127.1.0
fudge 127.127.1.0  stratum 10
restrict default nomodify notrap
restrict 127.127.1.0

### And here's our real servers to sync to
server 172.24.98.82 iburst



You can verify your server is connected to the DB server and syncing by running:
Code: Select all
ntpq -p


You will see a asterisk next to your DB server if it's synced. It CAN take a minute or two.


It worked for me ..great thanks