[ClusterLabs] Resource ocf:heartbeat:asterisk fails to start

FreeSoftwareServers freesoftwareservers at gmail.com
Fri Jun 17 19:05:12 UTC 2016


Just wanted to share!

 

This misinformation got me started down the wrong path, which was running
user/group root/root. Good old internet!

 

http://www.klaverstyn.com.au/david/wiki/index.php?title=Asterisk_Cluster

 

 

pcs resource create Asterisk ocf:heartbeat:asterisk params user="root"
group="root" op monitor timeout="30"
 
pcs constraint location Asterisk prefers node01
 
pcs resource delete Asterisk
 

Testing :

 

usr/lib/ocf/resource.d/heartbeat/asterisk start ; echo $?

1st Error :

/usr/lib/ocf/resource.d/heartbeat/asterisk: line 38:
/lib/heartbeat/ocf-shellfuncs: No such file or directory

Reso :

nano /usr/lib/ocf/resource.d/heartbeat/asterisk

~asterisk

# Initialization: 
 
. /usr/lib/ocf/lib/heartbeat/ocf-shellfuncs 
 
#: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} 
#. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs

Testing again>>

2nd Error :

INFO: Asterisk PBX is not running
ERROR: Directory /var/run/asterisk is not writable by asterisk

Reso :

chmod 777 /var/run/asterisk
chown asterisk:asterisk /var/run/asterisk
ls -la /var/run/ | grep asterisk

drwxrwxrwx 2 asterisk asterisk 60 Jun 17 14:22 asterisk

Success?:

root at node1:/var/run $ /usr/lib/ocf/resource.d/heartbeat/asterisk start ;
echo $?
INFO: Asterisk PBX is not running
INFO: 0 active channels 0 active calls 0 calls processed
DEBUG: Asterisk PBX monitor succeeded
INFO: Asterisk PBX started
0

Failover :

root at node2:~ $ /usr/lib/ocf/resource.d/heartbeat/asterisk start ; echo $?
INFO: Asterisk PBX is not running
INFO: 0 active channels 0 active calls 0 calls processed
DEBUG: Asterisk PBX monitor succeeded
INFO: Asterisk PBX started

Except :

Asterisk (ocf::heartbeat:asterisk): Stopped

Failed Actions:

*         Asterisk_start_0 on node2 'unknown error' (1): call=73,
status=Timed Out, exitreason='none',
last-rc-change='Fri Jun 17 14:25:57 2016', queued=0ms, exec=20001ms

Delete Resource and try again :

Success ?! :

Asterisk (ocf::heartbeat:asterisk): Started node2

Failover :

Failed Actions:

*         Asterisk_start_0 on node1 'unknown error' (1): call=23,
status=Timed Out, exitreason='none',
last-rc-change='Fri Jun 17 14:31:06 2016', queued=0ms, exec=20002ms

Start and Stop Cluster = Same thing, failed on node 1 and 2

root at node1:/var/run $ /usr/lib/ocf/resource.d/heartbeat/asterisk start ;
echo $?
INFO: Asterisk PBX is not running
INFO: 0 active channels 0 active calls 0 calls processed
DEBUG: Asterisk PBX monitor succeeded
INFO: Asterisk PBX started
0
root at node1:/var/run $ service asterisk status
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk)
Active: inactive (dead) since Fri 2016-06-17 14:03:45 EDT; 29min ago

 
<http://jira.freesoftwareservers.com/secure/ViewProfile.jspa?name=FreeSoftwa
reServers> admin at freesoftwareservers.com added a comment - 4 minutes ago -
edited

Solution !!!!!!

 
<http://manpages.ubuntu.com/manpages/wily/man7/ocf_heartbeat_asterisk.7.html
>
http://manpages.ubuntu.com/manpages/wily/man7/ocf_heartbeat_asterisk.7.html

wget
https://raw.githubusercontent.com/ClusterLabs/resource-agents/master/heartbe
at/asterisk -O /usr/lib/ocf/resource.d/heartbeat/asterisk
chmod +x /usr/lib/ocf/resource.d/heartbeat/asterisk
nano /usr/lib/ocf/resource.d/heartbeat/asterisk
# Initialization: 
 
. /usr/lib/ocf/lib/heartbeat/ocf-shellfuncs 
 
#: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} 
#. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
chmod 777 /var/run/asterisk
chown asterisk:asterisk /var/run/asterisk
pcs resource create Asterisk ocf:heartbeat:asterisk params binary="asterisk"
canary_binary="astercany" config="/etc/asterisk/asterisk.conf"
user="asterisk" group="asterisk" additional_parameters="-g -vvv" op monitor
timeout="30"
 
pcs constraint location Asterisk prefers node01
 
pcs resource delete Asterisk

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20160617/671aff47/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 174 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20160617/671aff47/attachment-0003.png>


More information about the Users mailing list