How Can I Move My HVR Hub Installation From EBS to AWS EFS Storage?
Question
How can I move my HVR Hub installation (HVR_HOME, HVR_CONFIG) from an Amazon Elastic Book Store (EBS) volume to Amazon Elastic File System (EFS)?
Environment
- HVR Hub
- Linux
- AWS EC2
- Amazon EFS
- Amazon EBS
Answer
Test this process on a non-production environment before applying it to production.
To migrate your HVR Hub installation from EBS to EFS:
Prepare the EFS mount:
i. Create or identify an EFS file system in the same VPC as your HVR EC2 instance.
ii. Install the NFS client on all Hub nodes. For RHEL, CentOS, or Amazon Linux, run:
yum -y install nfs-utilsiii. Create the EFS target directory, for example
/mnt/efs/hvr, and mount the EFS file system to verify permissions.iv. Confirm that the HVR operating system user can read from and write to the mount. For example:
chown -R hvruser:hvruser /mnt/efs/hvrStop HVR processes:
i. Stop all relevant HVR services:
systemctl stop hvrhubserverii. Confirm that no HVR-related processes are still running:
ps -ef | grep hvrBack up
HVR_HOMEandHVR_CONFIGusingtar -czfor another preferred method.Use
rsyncto copy the directories to the EFS mount while preserving file permissions and ownership:rsync -a /home/hvruser/hvr_home/ /mnt/efs/hvr/hvr_home/ rsync -a /home/hvruser/hvr_config/ /mnt/efs/hvr/hvr_config/You can use
mvand a symlink instead, but most prefer to keep the original files for rollback.Update environment variables:
i. Update
HVR_HOMEandHVR_CONFIGin all user profiles, such as.bash_profile, and update the system PATH.ii. If HVR is managed by systemd, update
/etc/systemd/system/hvrhubserver.servicesoExecStartpoints to the new locations.iii. Reload systemd:
systemctl daemon-reloadMount EFS persistently:
i. Add the EFS mount to
/etc/fstabon every node. For example:fs-<id>.efs.<region>.amazonaws.com:/ /mnt/efs/hvr nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0ii. Test the entry:
sudo umount /mnt/efs/hvr && sudo mount -a
For high availability (HA) deployments, configure the EFS mount and HVR Hub service consistently across all Hub nodes. If you use Pacemaker and Corosync, add the EFS mount as a cluster-managed filesystem resource so only the active node writes to the shared storage.
For multi-AZ deployments, configure the appropriate load balancer, virtual IP, or service endpoint. For more information, see HVR High Availability and the AWS EFS documentation.