Difference between revisions of "HA NFS on Amazon Linux 2"

From Michael's Information Zone
Jump to navigation Jump to search
Line 31: Line 31:
 
  sudo vgchange -an data
 
  sudo vgchange -an data
 
   0 logical volume(s) in volume group "data" now active
 
   0 logical volume(s) in volume group "data" now active
 +
</pre>
 +
*Configure LVM for clustering<ref>https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/high_availability_add-on_administration/s1-exclusiveactivenfs-HAAA</ref>
 +
<pre>
 +
sudo lvmconf --enable-halvm --services --startstopservices
 +
Warning: Stopping lvm2-lvmetad.service, but it can still be activated by:
 +
  lvm2-lvmetad.socket
 +
Removed symlink /etc/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket.
 +
 +
 
</pre>
 
</pre>

Revision as of 11:38, 15 December 2020

[1]

  • Will be using two t3a.larg instances in an active/passive config.
  • Package installation
sudo yum upgrade -y && sudo reboot -h now
sudo yum install pcs pacemaker fence-agents-all -y
  • Authorize nodes[2]
 sudo passwd hacluster
Changing password for user hacluster.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

sudo systemctl enable --now pcsd.service

 sudo pcs cluster auth 192.168.17.132 192.168.17.164
Username: hacluster
Password:
192.168.17.132: Authorized
192.168.17.164: Authorized
  • Create lvm, mount point, and deactivate the volume group[3].
sudo pvcreate /dev/nvme1n1
sudo vgcreate data /dev/nvme1n1
sudo lvcreate --size 195G --name nfs data
sudo mkfs.ext4 /dev/mapper/data-nfs
sudo mkdir -p /mnt/nfs
 sudo vgchange -an data
  0 logical volume(s) in volume group "data" now active
  • Configure LVM for clustering[4]
 sudo lvmconf --enable-halvm --services --startstopservices
Warning: Stopping lvm2-lvmetad.service, but it can still be activated by:
  lvm2-lvmetad.socket
Removed symlink /etc/systemd/system/sysinit.target.wants/lvm2-lvmetad.socket.