On 06/14/2012 07:34 AM, Zemke, Kai wrote:
Hi there,
You have seen these kind of mail probaply a thousand times. L
I have set up a two node cluster for our nagios monitoring service. I
have a primary/secondary shared drbd device and several resources needed
by nagios ( like apache, nsca, npcd, rrdcached and so on ). So far my
cluster is working as expected. Nut now I wanted to expand my
configuration with stonith. I have a Gude NET-8x-8210 PDU. As far as I
can see there is no ready to use plugin that ships with pacemaker for
me. So it looks like I have to create one myself. I searched the web for
nice documentations and/or tutorials but it looks like I have no luck here.
Is there a good documentation of these kind of work? I looked at the
shipped scripts but im more curious how pacemaker is passing parameters
and scriptcalling than just the plain sourcetext.
Is there something that you can point me to so that im able to write the
script myself?
Thanks in advance and kind regards,
Kai
Hi Kai,
The closest to a document is the FenceAgentAPI:
https://fedorahosted.org/cluster/wiki/FenceAgentAPI
One thing not yet mentioned there is that now the agent must write
out it's usage information as XML when given then action 'metadata'. You
can see what this should look like if you run 'fence_<foo> -o metadata'.
I've written a couple agents which you can use as templates, though
they are in perl. There are others written in bash and python, too, with
the names 'fence_*'. You should be able to view their source easily as
most (all?) are scripted languages.
If it helps, here are the two I've written:
1. This is for TrippLite switched PDUs. Note that SNMP is the preferred
method, when available (I used fence_apc_snmp as a template for this):
https://github.com/digimer/fence_tripplite_snmp
2. This is for fabric fencing using D-Link managed switches (fences by
disconnecting the node from the network, rather than rebooting it):
https://github.com/digimer/fence_dlink_snmp
Once you have your agent working, you can tie DRBD into Pacemaker by
telling DRBD to use the 'crm-fence-peer.sh' script. When DRBD detects a
fault, that script allows it to ask pacemaker to fence the node instead
of trying to do the fence itself. This is the preferred method.
If you run into problems or have any questions, feel free to ask here
or catch me (us) on IRC (freenode - #linux-cluster).
Cheers!
--
Digimer
Papers and Projects: https://alteeve.com
_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org