rhel 7.1 high-availability

Steps in implementing high-availability on Redhat 7.1:

  1. Set hostname in /etc/hosts
  2. yum install pcs fence-agents-all
  3. firewall-cmd –permanent –add-service=high-availability
  4. firewall-cmd –add-service=high-availability
  5. passwd hacluster
  6. systemctl start pcsd
  7. systemctl enable pcsd
  8. pcs cluster auth suppnfs01
  9. pcs cluster setup –start –name nfspacemaker suppnfs01
  10. pcs cluster enable –-all
  11. pcs cluster status
  12. pcs stonith create imm-fencing-suppnfs01 fence_imm params ipaddr=”192.168.10.7″ pcmk_host_list=”suppnfs01″ pcmk_host_check=”static-list” action=”off” login=”*****” passwd=”*****” delay=”30″
  13. pcs stonith show imm-fencing-suppnfs01
  14. pvcreate /dev/mapper/mpatha
  15. vgcreate vg01 /dev/mapper/mpatha
  16. lvcreate -L1.6T -n lvnfsshare vg01
  17. lvs
  18. ext4 /dev/vg01/lvnfsshare
  19. mkdir /share
  20. mount /dev/vg01/lvnfsshare /share
  21. mkdir –p /share/exports/data
  22. mkdir –p /share/exports/phpc
  23. touch /share/exports/data/testfile
  24. touch /share/exports/phpc/testfile
  25. umount /dev/vg01/lvnfsshare
  26. vgchange –an vg01
  27. vgs –noheadings -o vg_name

[root@suppnfs01 ~]# vgs --noheadings -o vg_name
rhel
vg01

  1. add line:

volume_list = [ "rhel" ]
to /etc/lvm/lvm.conf

  1. dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
  2. reboot;exit
  3. pcs cluster status
  4. pcs resource create lvmshare LVM volgrpname=vg01 exclusive=true –group nfsgroup
  5. pcs resource create nfsshare Filesystem device=/dev/vg01/lvnfsshare directory=/share fstype=ext4 –group nfsgroup
  6. pcs resource create nfs-daemon nfsserver nfs_shared_infodir=/share/nfsinfo nfs_no_notify=true –group nfsgroup
  7. pcs resource create nfs-root exportfs clientspec=* options=rw,sync,no_root_squash directory=/share/exports fsid=0 –group nfsgroup
  8. pcs resource create nfs-home exportfs clientspec=* options=rw,sync,no_root_squash directory=/share/exports/data fsid=1 –group nfsgroup
  9. pcs resource create nfs-phpc exportfs clientspec=* options=rw,sync,no_root_squash directory=/share/exports/phpc fsid=2 –group nfsgroup
  10. pcs resource create nfsha_ip IPaddr2 ip=192.168.9.5 cidr_netmask=24 –group nfsgroup

Notes:

  • blue items are supposed to run on both servers
  • in green items, you may need to add more servers (e.g.”.. suppnfs01 suppnfs02″)
  • items in orange color must be repeated for other server

Source: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/High_Availability_Add-On_Administration/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s