diff --git a/doc/Clusters_from_Scratch/en-US/Ch-Active-Active.xml b/doc/Clusters_from_Scratch/en-US/Ch-Active-Active.xml index db6c122c22..636a51ea2e 100644 --- a/doc/Clusters_from_Scratch/en-US/Ch-Active-Active.xml +++ b/doc/Clusters_from_Scratch/en-US/Ch-Active-Active.xml @@ -1,225 +1,233 @@ %BOOK_ENTITIES; ]> - Reconfigure Pacemaker for Active/Active - - Almost everything is in place. Recent versions of DRBD are capable of operating in Primary/Primary mode and the filesystem we’re using is cluster aware. All we need to do now is reconfigure the cluster to take advantage of this. - - - This will involve a number of changes, so we’ll again use interactive mode. - - - + Conversion to Active/Active + + The primary requirement for an Active/Active cluster is that the data required for your services are available, simultaneously, on both machines. + Pacemaker makes no requirement on how this is achieved, you could use a SAN if you had one available, however since DRBD supports multiple Primaries, we can also use that. + + + The only hitch is that we need to use a cluster-aware filesystem (and the one we used earlier with DRBD, ext4, is not one of those). + Both OCFS2 and GFS2 are supported, however here we will use GFS2 which comes with &DISTRO; &DISTRO_VERSION; . + +
+ Reconfigure Pacemaker for Active/Active + + Almost everything is in place. + Recent versions of DRBD are capable of operating in Primary/Primary mode and the filesystem we’re using is cluster aware. + All we need to do now is reconfigure the cluster to take advantage of this. + + + This will involve a number of changes, so we’ll again use interactive mode. + + + crm cib new active - - - There’s no point making the services active on both locations if we can’t reach them, so lets first clone the IP address. Cloned IPaddr2 resources use an iptables rule to ensure that each request only processed by one of the two clone instances. The additional meta options tell the cluster how many instances of the clone we want (one “request bucket” for each node) and that if all other nodes fail, then the remaining node should hold all of them. Otherwise the requests would be simply discarded. - - - + + + There’s no point making the services active on both locations if we can’t reach them, so lets first clone the IP address. + Cloned IPaddr2 resources use an iptables rule to ensure that each request only processed by one of the two clone instances. + The additional meta options tell the cluster how many instances of the clone we want (one “request bucket” for each node) and that if all other nodes fail, then the remaining node should hold all of them. + Otherwise the requests would be simply discarded. + + configure clone WebIP ClusterIP  \         meta globally-unique=”true” clone-max=”2” clone-node-max=”2” - - - Now we must tell the ClusterIP how to decide which requests are processed by which hosts. To do this we must specify the clusterip_hash parameter. - - - Open the ClusterIP resource - - -configure edit  ClusterIP - - - And add the following to the params line - - -clusterip_hash="sourceip" - - - So that the complete definition looks like: - - - + + + Now we must tell the ClusterIP how to decide which requests are processed by which hosts. + To do this we must specify the clusterip_hash parameter. + + + Open the ClusterIP resource + + configure edit  ClusterIP + + And add the following to the params line + + clusterip_hash="sourceip" + + So that the complete definition looks like: + + primitive ClusterIP ocf:heartbeat:IPaddr2 \         params ip="192.168.122.101" cidr_netmask="32" clusterip_hash="sourceip" \         op monitor interval="30s" - - - Here is the full transcript - - - + + + Here is the full transcript + + [root@pcmk-1 ~]# crm crm(live)# cib new active INFO: active shadow CIB created crm(active)# configure clone WebIP ClusterIP  \         meta globally-unique=”true” clone-max=”2” clone-node-max=”2” crm(active)# configure show node pcmk-1 node pcmk-2 primitive WebData ocf:linbit:drbd \         params drbd_resource="wwwdata" \         op monitor interval="60s" primitive WebFS ocf:heartbeat:Filesystem \         params device="/dev/drbd/by-res/wwwdata" directory="/var/www/html" fstype=”gfs2” primitive WebSite ocf:heartbeat:apache \         params configfile="/etc/httpd/conf/httpd.conf" \         op monitor interval="1min" primitive ClusterIP ocf:heartbeat:IPaddr2 \         params ip=”192.168.122.101” cidr_netmask=”32” clusterip_hash=”sourceip” \         op monitor interval="30s" primitive dlm ocf:pacemaker:controld \         op monitor interval="120s" primitive gfs-control ocf:pacemaker:controld \    params daemon=”gfs_controld.pcmk” args=”-g 0” \         op monitor interval="120s" ms WebDataClone WebData \         meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" clone WebIP ClusterIP \ meta globally-unique=”true” clone-max=”2” clone-node-max=”2” clone dlm-clone dlm \         meta interleave="true" clone gfs-clone gfs-control \         meta interleave="true" colocation WebFS-with-gfs-control inf: WebFS gfs-clone colocation WebSite-with-WebFS inf: WebSite WebFS colocation fs_on_drbd inf: WebFS WebDataClone:Master colocation gfs-with-dlm inf: gfs-clone dlm-clone colocation website-with-ip inf: WebSite WebIP order WebFS-after-WebData inf: WebDataClone:promote WebFS:start order WebSite-after-WebFS inf: WebFS WebSite order apache-after-ip inf: WebIP WebSite order start-WebFS-after-gfs-control inf: gfs-clone WebFS order start-gfs-after-dlm inf: dlm-clone gfs-clone property $id="cib-bootstrap-options" \         dc-version="1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7" \         cluster-infrastructure="openais" \         expected-quorum-votes=”2” \         stonith-enabled="false" \         no-quorum-policy="ignore" rsc_defaults $id="rsc-options" \         resource-stickiness=”100” - - - Notice how any constraints that referenced ClusterIP have been updated to use WebIP instead. This is an additional benefit of using the crm shell. - - - Next we need to convert the filesystem and Apache resources into clones. Again, the shell will automatically update any relevant constraints. - - - + + + Notice how any constraints that referenced ClusterIP have been updated to use WebIP instead. + This is an additional benefit of using the crm shell. + + + Next we need to convert the filesystem and Apache resources into clones. + Again, the shell will automatically update any relevant constraints. + + configure clone WebFSClone WebFS configure clone WebSiteClone WebSite - - - The last step is to tell the cluster that it is now allowed to promote both instances to be Primary (aka. Master). - - - + + + The last step is to tell the cluster that it is now allowed to promote both instances to be Primary (aka. Master). + + configure edit WebDataClone - - - Change master-max to 2 - + + + Change master-max to 2 + - + node pcmk-1 node pcmk-2 primitive WebData ocf:linbit:drbd \         params drbd_resource="wwwdata" \         op monitor interval="60s" primitive WebFS ocf:heartbeat:Filesystem \         params device="/dev/drbd/by-res/wwwdata" directory="/var/www/html" fstype=”gfs2” primitive WebSite ocf:heartbeat:apache \         params configfile="/etc/httpd/conf/httpd.conf" \         op monitor interval="1min" primitive ClusterIP ocf:heartbeat:IPaddr2 \         params ip=”192.168.122.101” cidr_netmask=”32” clusterip_hash=”sourceip” \         op monitor interval="30s" primitive dlm ocf:pacemaker:controld \         op monitor interval="120s" primitive gfs-control ocf:pacemaker:controld \    params daemon=”gfs_controld.pcmk” args=”-g 0” \         op monitor interval="120s" ms WebDataClone WebData \         meta master-max="2" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" clone WebFSClone WebFS clone WebIP ClusterIP  \         meta globally-unique=”true” clone-max=”2” clone-node-max=”2” clone WebSiteClone WebSite clone dlm-clone dlm \         meta interleave="true" clone gfs-clone gfs-control \         meta interleave="true" colocation WebFS-with-gfs-control inf: WebFSClone gfs-clone colocation WebSite-with-WebFS inf: WebSiteClone WebFSClone colocation fs_on_drbd inf: WebFSClone WebDataClone:Master colocation gfs-with-dlm inf: gfs-clone dlm-clone colocation website-with-ip inf: WebSiteClone WebIP order WebFS-after-WebData inf: WebDataClone:promote WebFSClone:start order WebSite-after-WebFS inf: WebFSClone WebSiteClone order apache-after-ip inf: WebIP WebSiteClone order start-WebFS-after-gfs-control inf: gfs-clone WebFSClone order start-gfs-after-dlm inf: dlm-clone gfs-clone property $id="cib-bootstrap-options" \         dc-version="1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7" \         cluster-infrastructure="openais" \         expected-quorum-votes=”2” \         stonith-enabled="false" \         no-quorum-policy="ignore" rsc_defaults $id="rsc-options" \         resource-stickiness=”100” - - - Review the configuration before uploading it to the cluster, quitting the shell and watching the cluster’s response - - - + + + Review the configuration before uploading it to the cluster, quitting the shell and watching the cluster’s response + + crm(active)# cib commit active INFO: commited 'active' shadow CIB to the cluster crm(active)# quit bye [root@pcmk-1 ~]# crm_mon ============ Last updated: Thu Sep  3 21:37:27 2009 Stack: openais Current DC: pcmk-2 - partition with quorum Version: 1.0.5-462f1569a43740667daf7b0f6b521742e9eb8fa7 2 Nodes configured, 2 expected votes 6 Resources configured. ============ Online: [ pcmk-1 pcmk-2 ] Master/Slave Set: WebDataClone         Masters: [ pcmk-1 pcmk-2 ] Clone Set: dlm-clone         Started: [ pcmk-2 pcmk-1 ] Clone Set: gfs-clone         Started: [ pcmk-2 pcmk-1 ] Clone Set: WebIP Started: [ pcmk-1 pcmk-2 ] Clone Set: WebFSClone Started: [ pcmk-1 pcmk-2 ] Clone Set: WebSiteClone Started: [ pcmk-1 pcmk-2 ] - -
- Recovery - - - TODO: Put one node into standby to demonstrate failover - - -
- +
+
+
+ Testing Recovery + + + TODO: Put one node into standby to demonstrate failover + + +