Enabling High Availability - pkoutoupis/rapiddisk GitHub Wiki
Copy the /etc/rapiddisk/rapiddisk.sh.rgmanager file to the /usr/share/cluster/ directory.
# cp /etc/rapiddisk/rapiddisk.sh.rgmanager /usr/share/cluster/rapiddisk.sh
Change its permissions:
# chmod 755 /usr/share/cluster/rapidddisk.sh
Generate the metadata file:
# sh /usr/share/cluster/rapiddisk.sh meta-data > /usr/share/cluster/rapiddisk.metadata
Then update the schema for the cluster manager, in this case CMAN:
# /usr/sbin/ccs_update_schema -v -f
Now, you should be able to add the new resource in the /etc/cluster/cluster.conf file. Refer to the example below:
<rm>
<failoverdomains>
<failoverdomain name="FD" ordered="1" restricted="0">
<failoverdomainnode name="node-01" priority="1"/>
<failoverdomainnode name="node-02" priority="2"/>
</failoverdomain>
</failoverdomains>
<resources>
<rapiddisk name="rcache-fo" volume="/dev/sdb" size="512"/>
</resources>
<service autostart="1" domain="FD" name="serv" recovery="relocate">
<rapiddisk ref="rcache-fo"/>
</service>
</rm>
By default, the resource agent sets the RapidDisk-Cache volume to Write Through mode. If you prefer Write Around, add the following parameter option to the defines resource: mode="wa"
This section assumes that you are running Corosync with Pacemaker.
Create the following directory: /usr/lib/ocf/resource.d/rapiddisk and copy the rapiddisk.sh.pacemaker file to it.
# mkdir /usr/lib/ocf/resource.d/rapiddisk
# cp /etc/rapiddisk/rapiddisk.sh.pacemaker /usr/lib/ocf/resource.d/rapiddisk/rapiddisk.sh
# chmod 755 /usr/lib/ocf/resource.d/rapiddisk/rapiddisk.sh
Verify that Corosync can see the new resource:
# crm ra list ocf rapiddisk
rapiddisk
Add a new HA service for Corosync to monitor.
# crm configure primitive rcache-fo ocf:rapiddisk:rapiddisk.sh params name="sdb_ha" volume="/dev/sdb" size="512" op monitor interval="10s"
# crm configure location prefer-node-01 rapiddisk.sh rcache-fo node-01
By default, the resource agent sets the RapidDisk-Cache volume to Write Through mode. If you prefer Write Around:
# crm configure primitive rcache-fo ocf:rapiddisk:rapiddisk.sh params name="sdb_ha" volume="/dev/sdb" size="512" mode="wa" op monitor interval="10s"
View the status of the resource:
# crm status
Last updated: Sun Oct 4 15:49:06 2015
Last change: Sun Oct 4 15:47:13 2015 via crm_resource on node-01
Stack: corosync
Current DC: node-01 (167772261) - partition with quorum
Version: 1.1.10-42f2063
2 Nodes configured
2 Resources configured
Online: [ node-01 node-02 ]
rcache-fo (ocf::rapiddisk:rapiddisk.sh): Started node-01