While Yves presents a valid approach for managing NDB with Pacemaker and the anything Linux-HA resource agent (a generic wrapper for any daemon based application), the XML configuration shown is likely to have people running away screaming. This is how we had to do things back in the Heartbeat 2 days, which meant that as a cluster admin you would permanently run around with a loaded cocked shotgun with the muzzle pressed firmly against your foot.
Those days are long gone. Please don’t do this anymore. You also no longer need to use the low-level tools such as cibadmin or crm_attribute.
We have the crm shell for those things now. So instead of
crm_attribute -t crm_config -n stonith-enabled -v false crm_attribute --attr-name symmetric-cluster --attr-value false
we now simply write
crm configure property stonith-enabled=false symmetric-cluster=false
Can’t remember a property name or supported value? Interactive mode and tab completion to the rescue:
# crm configure crm(live)configure# property sto<tab> stonith-action= stonith-enabled= stonith-timeout= crm(live)configure# property stonith-enabled=<tab> stonith-enabled (boolean, [true]): Failed nodes are STONITH'd crm(live)configure# property stonith-enabled=false symmetric-cluster=false crm(live)configure# commit
A bit more convenient, isn’t it? Now let’s get rid of dealing with XML. Instead of a horrific avalanche of tags and attributes that we then have to feed into the system with cibadmin, let’s do this!
# crm configure crm(live)configure# primitive mgmd ocf:heartbeat:anything \ params binfile="/usr/local/bin/fake_ndb_mgmd" crm(live)configure# primitive ndbcluster ocf:heartbeat:anything \ params binfile="/usr/local/bin/fake_ndb_cluster_start" crm(live)configure# primitive ndbd ocf:heartbeat:anything \ params binfile="/usr/local/bin/fake_ndbd" crm(live)configure# clone ndbdclone ndbd \ meta clone-max=2 crm(live)configure# location loc-1 mgmd inf: testvirtbox crm(live)configure# location loc-2 ndbcluster inf: testvirtbox crm(live)configure# location loc-3 ndbdclone -inf: testvirtbox crm(live)configure# order ordered-set-1 inf: mgmd ndbdclone ndbcluster crm(live)configure# commit
And of course, we get tab completion and online help there too. Give it a shot!
A great post, now I know how I should have done it. I think part of the problem comes from the available documentation, especially the one found by Google. Documentation using cibadmin overwhelms the available doc on the crm shell.