Amazon EC2 Elastic Load Balancer: Does its IP ever Change?
Does the ELB's IP Ever Ch开发者_JAVA百科ange once setup, or will it always access instances from the same location during its lifetime no matter what might be going on with it behind the scenes at Amazon?
ELB's IP address keeps changing. You should instead use the DNS name provided to you.
http://developer.amazonwebservices.com/connect/thread.jspa?threadID=32280
The short answer: Yes, ELB's IP addresses (both the ones that are publicly distributed to clients of your service, and the internal IPs from which ELB sends traffic to your instances) dynamically change.
The long answer: See my article about how ELB works for more info: http://shlomoswidler.com/2009/07/elastic-in-elastic-load-balancing-elb/
I understand this question has been already answered but I found the article "Best Practices in Evaluating Elastic Load Balancing" on the AWS site that explains why the ELB's IP addresses keep changing.
By default, Elastic Load Balancing will return multiple IP addresses when clients perform a DNS resolution, with the records being randomly ordered on each DNS resolution request.
...and the importance to ask to the DNS the actual IPs to use
If clients do not re-resolve the DNS at least once per minute, then the new resources Elastic Load Balancing adds to DNS will not be used by clients.
http://aws.amazon.com/articles/1636185810492479
Note: originally ELB (Elastic Load Balancer) referred to an L7 balancer what is now called ALB (Application Load Balancer), which indeed has changing IPs.
But there's an other kind of ELB, the L4 NLB (Network Load Balancer), which by default uses static IP addresses (and you can stick Elastic IP as well, if you want flexibility of moving the ElasticIP around).
So it is important to distinguish which ELB we are talking about - ALB or NLB.
精彩评论