Hi,
Forgot to attach the file, sorry.
Respectfully
Dimitry Nagorny
Trainee
Von: Nagorny, Dimitry [mailto:[email protected]]
Gesendet: Dienstag, 22. März 2016 13:32
An: [email protected]
Betreff: [ClusterLabs] Resource creation fails
Good afternoon all,
My setup is that I have successfully running two CentOS 7.2 Server nodes in a
pacemaker cluster with failover on a virtual IP. Both Servers act as OpenSIPS.
I wrote my own ocf script to surveil that the opensips pid is still there so I
can assume opensips is still running (very basic but its all I want for the
moment).
My problem: If I want to create the resource I am getting messages that I can't
interpret and can't find anything about it with the help of google:
Traceback (most recent call last):
File "/usr/sbin/pcs", line 219, in <module>
main(sys.argv[1:])
File "/usr/sbin/pcs", line 159, in main
cmd_map[command](argv)
File "/usr/lib/python2.7/site-packages/pcs/resource.py", line 42, in
resource_cmd
resource_create(res_id, res_type, ra_values, op_values, meta_values,
clone_opts)
File "/usr/lib/python2.7/site-packages/pcs/resource.py", line 538, in
resource_create
bad_opts, missing_req_opts = utils.validInstanceAttributes(ra_id, params ,
get_full_ra_type(ra_type, True))
File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 1770, in
validInstanceAttributes
for action in actions.findall("parameter"):
AttributeError: 'NoneType' object has no attribute 'findall'
I get this after entering: pcs resource create opensips ocf:opensips:opensips
op monitor interval=15s
The ocf is stored in /usr/lib/ocf/resource.d/opensips/opensips.
Please find attached the ocf script. If anything else is needed please ask.
1. What wants the traceback tell me?
2. Is there any way to check the ocf on centOS7? ocf-tester is not
available.
3. Any hint on how to solve this?
Very Respectfully
Dimitry Nagorny
Trainee
#!/bin/sh
#
# opensips
###################################################
# Initialization:
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
###################################################
usage() {
cat <<-!
usage: $0 {start|stop|meta-data|monitor}
!
}
meta_data() {
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="opensips">
<version>1.0</version>
<longdesc lang="en">
Resource Agent for the OpenSIPS SIP Proxy.
</longdesc>
<shortdesc lang="en">OpenSIPS resource agent</shortdesc>
<actions>
<action name="start" timeout="30" />
<action name="stop" timeout="30" />
<action name="monitor" depth="0" timeout="30" interval="10" start-delay="30" />
<action name="meta-data" timeout="5" />
</actions>
</resource-agent>
END
}
monitor_opensips() {
if [ -f /var/run/opensips.pid ]
then
return $OCF_SUCCESS
else
return $OCF_ERR_GENERIC
fi
}
start_opensips() {
/usr/local/opensips_21/sbin/opensips start -P /var/run/opensips.pid -m 1024
-M 16 -f /usr/local/opensips_21/etc/opensips/opensips.cfg > /dev/null
sleep 1
monitor_opensips
}
stop_opensips() {
return $OCF_SUCCESS
}
############
# MAIN #
############
case "$1" in
meta_data) meta_data
exit $OCF_SUCCESS;;
start) start_opensips;;
stop) stop_opensips;;
monitor) monitor_opensips;;
usage) usage
exit $OCF_SUCCESS;;
*) usage
exit $OCF_ERR_UNIMPLEMENTED;;
esac
exit $?_______________________________________________
Users mailing list: [email protected]
http://clusterlabs.org/mailman/listinfo/users
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org