Today UPC broke my internet connection.. entirely. For 4 hrs. Four long, painful hours… up to this point I was having a nightmare trying to debug why a KVM based asterisk cluster was not talking to each another. Following the fairly straight-forward and very short walk through at https://wiki.asterisk.org/wiki/display/AST/Distributed+Device+State+with+AIS which is essentially the same (or 99% close!) on every Google-able page on the internet, I was getting nowhere. After compiling OpenAIS & Corosync and then recompiling Asterisk, the cluster worked.. until starting the cluster resource in Asterisk’s console which gave
ERROR[19134]: ais/clm.c:140 ast_ais_clm_load_module: Could not initialize cluster membership service: Unknown
And in the Corosync log:
Jul 11 13:16:17 corosync [IPC ] Invalid IPC credentials.
It wasn’t till IRC & Google were wrestled from my hands that I really started to dig in the src directory and the accompanying documents. Tut tut I know. It was simple. There is a new (well how new I don’t know, but certainly I’ve found it nowhere else! Including Asterisk: The Definitive Guide) auth mechanism where you specify what users can send/receive messages via Corosync. Create a new file in
/etc/corosync/uidgid.d/
I called mine asterisk, and in it I added the user and group (both asterisk in my case) you want to allow. You can add as many as you want. So in mine I had:
uidgid { uid: asterisk gid: asterisk }
And that was it. Quick restart of everything and it was fixed. Thank you UPC/unknown_individual_with_a_JCB you saved my sanity!
8 comments
Comments feed for this article
Thursday, July 14, 2011 at 13:59
Denis
Worked on Ubuntu 10.04
Thanks!
Wednesday, September 28, 2011 at 18:48
Sebastien
Thanks for that.
Saturday, October 22, 2011 at 23:45
Leif Madsen (@leifmadsen)
Well done! I’ll be sure to make a note of it in Asterisk: The Definitive Guide!
Sunday, October 23, 2011 at 13:00
Félim
A very cool book I might add! Only got back into Asterisk after a fairly long break, was excellent resource 🙂
Sunday, October 23, 2011 at 13:24
Leif Madsen (@leifmadsen)
Glad you enjoyed it! I actually hadn’t setup res_ais on a box that wasn’t running Asterisk as root before, and ran into the exact same issue you had. Saved me hours trying to figure out the issue and got me back to writing dialplan and configuration files for my presentation at AstriCon this week! Thanks again!
Monday, December 26, 2011 at 22:07
Aleksey V Kashin
hi. I’ve added this but when i restart corosync i’ve got error in syslog:
Dec 27 01:58:55 serv2 corosync[28996]: [corosy] ERROR: The ‘asterisk’ group is not found in /etc/group, please read the documentation.
What does that mean?
# grep asterisk /etc/group
dialout:x:20:asterisk
audio:x:29:asterisk
asterisk:x:221:
asterisk 1.8.8
thanks.
Wednesday, December 28, 2011 at 16:08
Félim
Hi Aleksey (I was on holidays hence the delay),
It does look as if asterisk the group exists but how did you create it? Also what distro are you running it on, it’s a fairly low number for a user added group. Good way to test it is to log in as the asterisk user and run the “groups” command, it should list the asterisk group along with any others your asterisk user is running under.
Thursday, December 29, 2011 at 16:28
Aleksey V Kashin
Hi. I use Debian Squeeze and I created asterisk account manually before install asterisk because i need have same uid on the all servers
So, I logged under asterisk user and saw next:
kashin@serv2:~$ sudo -u asterisk -s
asterisk@serv2:/home/kashin$ id
uid=221(asterisk) gid=221(asterisk) groups=221(asterisk),20(dialout),29(audio)
asterisk@serv2:/home/kashin$ groups
asterisk dialout audio
Maybe, it’s wrong to create account manually…
In the end, I left only uid in the file and it’s worked.
Thanks!