0

I have an Ubuntu 14.04 based NFS server AMI wrapped with a Launch Configuration and an Auto Scaling Group of just a single instance (min/max/req). This is just to make sure that if the server goes down, a new one will automatically replace it. The shared directories are located on an attached EBS volume. I need to make sure that when a server goes down for whatever reason, and a new one comes up, it will have the same Internal IP and will attach the EBS to it, so it can keep on serving the NFS clients. I figure the best approach would be using cloud-init. Any ideas on how to attached the EBS and set an internal IP would be appreciated!

Thank you in advance! Amit.

2

You cannot specify the private IP in an Auto Scaling Group, but there is a way to accomplish the same goal. Use a userdata script to attach the same EIP to the instance upon launch. You can then use the public DNS of the EIP as the remote host for your NFS clients.

When the NFS clients use DNS to perform a lookup on the public DNS of the NFS server, they will be returned the private IP of the instance.

  • Interesting approach. Thank you for the idea! Any insights about the attaching of the EBS? – Amit Dunsky Apr 29 '15 at 8:16
  • As long as you have the "DeleteOnTermination" flag set to false, you can attach the same volume upon startup of the new instance, via the CLI aws ec2 attach-volume --instance-id <this-instance-id> --volume-id <nfs-volume> – Chad Smith Apr 29 '15 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.