Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Apache W/O Virtual/Floating_IP

pcs cluster cib www_clust_cfg
pcs -f www_clust_cfg resource create www_drbd_res ocf:linbit:drbd drbd_resource=varwww op monitor interval=60s

pcs -f www_clust_cfg resource master WWWClone www_drbd_res master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true

pcs -f www_clust_cfg resource create www_fs ocf:heartbeat:Filesystem device="/dev/drbd2" directory="/var/www" fstype="ext4"

pcs -f www_clust_cfg resource create www_service ocf:heartbeat:apache  \
      configfile=/etc/httpd/conf/httpd.conf \
      statusurl="http://localhost/server-status" \
      op monitor interval=1min
pcs -f www_clust_cfg resource group add WWW-Group www_fs www_service
pcs -f www_clust_cfg constraint order promote WWWClone then WWW-Group
pcs -f www_clust_cfg constraint colocation add WWW-Group with WWWClone INFINITY with-rsc-role=Master
pcs -f www_clust_cfg constraint location WWW-Group prefers node1
pcs -f www_clust_cfg constraint
[root@node1 ~]# pcs -f www_clust_cfg constraint
Location Constraints:
  Resource: WWW-Group
    Enabled on: node1 (score:50)
Ordering Constraints:
  promote WWWClone then start WWW-Group (kind:Mandatory)
Colocation Constraints:
  WWW-Group with WWWClone (score:INFINITY) (with-rsc-role:Master)
pcs cluster cib-push www_clust_cfg
pcs status

Apache/HTTPD with www_vip 10.1.8.3

pcs cluster cib www_clust_cfg
pcs -f www_clust_cfg resource create www_virtual_ip ocf:heartbeat:IPaddr2 ip=10.1.8.3 cidr_netmask=32 nic=eth0 op monitor interval=30s
pcs -f www_clust_cfg resource create varwww_drbd_res ocf:linbit:drbd drbd_resource=varwww op monitor interval=60s
pcs -f www_clust_cfg resource master VARWWWClone varwww_drbd_res master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
pcs -f www_clust_cfg resource create varwww ocf:heartbeat:Filesystem device="/dev/drbd2" directory="/var/www" fstype="ext4"
pcs -f www_clust_cfg resource create www_service ocf:heartbeat:apache  \
      configfile=/etc/httpd/conf/httpd.conf \
      statusurl="http://localhost/server-status" \
      op monitor interval=1min
pcs -f www_clust_cfg resource group add WWW-Group varwww www_virtual_ip www_service 
pcs -f www_clust_cfg constraint order promote VARWWWClone then WWW-Group
pcs -f www_clust_cfg constraint colocation add WWW-Group with VARWWWClone INFINITY with-rsc-role=Master
pcs -f www_clust_cfg constraint location WWW-Group prefers node1
pcs -f www_clust_cfg constraint
pcs cluster cib-push www_clust_cfg
pcs status
  • No labels