Somasundaram Sekar
Somasundaram Sekar

Reputation: 5524

How to add nodes of a autoscaling group automatically to nginx or HAProxy?

enter image description here

In the above architecture (source: http://media.amazonwebservices.com/AWS_Web_Hosting_Best_Practices.pdf), The application server cluster belong to an autoscaling group. But is load balanced by a software loadbalancer (like nginx or HAProxy). My question is if the how the nodes in autoscaling group registers itself automatically with the loadbalancer(As I understand Elastic loadbalancer has this capability builtinm which may not be case for nginx or HAProxy)

Upvotes: 2

Views: 2129

Answers (2)

Piotrgo
Piotrgo

Reputation: 313

There's a great blog post on how to do this using PHP app.

http://www.kloppmagic.ca/auto-scaling-with-haproxy/

Of course you could use other tools like consul and service discovery baked into your image.

Upvotes: 0

zoran jeremic
zoran jeremic

Reputation: 2138

When you create Autoscaling group in AWS, you connect it with launch configuration which is responsible for launching new instances of the specific image, so each instance is automatically assigned to autoscaling group.

In the next step, you register your load balancer with your autoscaling group, so load balancer can use any of the instances that belongs to the group. Please check this tutorial http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-register-lbs-with-asg.html

Zoran

Upvotes: 2

Related Questions