0

I want to set up a 3-instance sentinel cluster in AWS and then have a master and standby redis instance controlled by the sentinel cluster. The question is how to deal with DHCP in an AWS VPC. Since the redis and sentinel cluster have to know where to look for each other, it seems to me there is no way to get around assigning static IPs to all of the instances.

  1. Am I assuming correctly or is there a way to create a sentinel/redis cluster without static IPs?

  2. If that's the case and I have to assign static IPs to the instances, there's a risk that the IP will be taken by another instance in the VPC and therefore the launching of the instance will fail. Does anyone know if there's a way around that problem?

numb3rs1x
  • 513
  • 1
  • 4
  • 6
  • Why not use elasticache for redis? – jordanm May 04 '17 at 17:58
  • Woops. I misread that. We want to remain as independent of Amazon's more specialized services if we can. Also, we're migrating an established infrastructure from our datacenter to AWS, and trying to keep as much the same in the configuration as we can. – numb3rs1x May 04 '17 at 18:09
  • Can you use domain names? You can use a private route53 hosted zone to give machines names that map to their IPs. – Tim May 04 '17 at 18:48
  • I was thinking that I could go that route as a last resort. I would ideally like to stay with IP addresses because I don't want to deal with TTL of the records. I will also have to figure out a way for replacement instances to automatically take the records, probably in Terraform. I'm discovering the less you have to put in TF the better. – numb3rs1x May 04 '17 at 18:58

1 Answers1

0

The only way I can find to assign a private static IP to an EC2 instance is to create an Elastic Network Interface (ENI), specify the IP when you create it, then attach it to your EC2 instance.

AWS EC2 Static IP

Tim
  • 31,888
  • 7
  • 52
  • 78
  • It's not a matter of how to assign the IP that I'm after. My two questions are: 1. Is there a way to build the cluster without the use of static IPs (or DNS for that matter)? 2. If not, is there a way to guarantee the static IP will always be available _only_ for the given instance? – numb3rs1x May 04 '17 at 20:02
  • 1) Can't help sorry. 2) There doesn't seem to be a lot of documentation in this area. I have to assume that AWS is smart enough not to assign an IP twice. If you really need to know this is a question for AWS support, which costs $29 per month. – Tim May 04 '17 at 20:10