lists at alteeve
Jun 14, 2012, 8:42 AM
Post #2 of 2
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,
The closest to a document is the 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):
2. This is for fabric fencing using D-Link managed switches (fences by
disconnecting the node from the network, rather than rebooting it):
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).
Papers and Projects: https://alteeve.com
Pacemaker mailing list: Pacemaker [at] oss
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf