Nfs – Autoscaling and NFS Server

amazon ec2amazon-ebsamazon-web-servicesautoscalingnfs

I have a WebServer say WS-1 and a NFS server say NFS-1 setup on AWS. WS-1 is being managed by an elastic load balancer and also autoscaled. It also has an EBS mounted on /var/www which contains all application code.

  • During autoscaling if another WS-X is launched will the /var/www mounted EBS also cloned and attached to that as well? If not, what are my options besides hosting code on root EBS volume?

  • Access inside NFS is defined on IP basis like 10.0.0.1/32(rw,…). During autoscaling more instances will be launched, how can i allow them to connect to NFS server and mounted the shared directory? I don't want to give access to private IP subnet using NFS, while on the Security Group level i have given access to NFS server to 0.0.0.0/0. NFS server uses fixed ports like 111, 2049, 4000-4002.

Best Answer

On scaling up, the EBS volume and its data will not be "cloned". To have this behavior you'd want to automate it at boot.

  1. Grab the latest snapshot of WS-1 EBS volume
  2. Create and attach the volume

Another method, depending on how much data is on the EBS, is to pull it down from S3.

With the security group, you can allow any server in the app_security_group to have access to any server in the nfs_server_group. This will allow you to dynamically update the security groups.

Hope that makes sense.

Related Topic