[英]How do I configure a load balancer in an AWS Elastic Beanstalk environment?
I have a Elastic Beanstalk enviroment that works perfectly when I configure the capacity as a single instance. 我有一个Elastic Beanstalk环境,当我将容量配置为单个实例时,它可以完美工作。 The SpringBoot app respond without problems on the port 8083, for example when I make a POST petition like " http://54.162.95.157:8083/login " (54.162.95.157 that is the public ip of ec2 instance). SpringBoot应用程序在端口8083上响应没有问题,例如,当我发出POST请求时,例如“ http://54.162.95.157:8083/login”(54.162.95.157是ec2实例的公共ip)。 But when I change the Beanstalk environment to a balanced load, the environment stops working. 但是,当我将Beanstalk环境更改为平衡负载时,该环境停止工作。 The POST request now I do it to the DNS of the load balancer, for example " http://awseb-em-AWSEBLoa-VVP8D98KT5SX-219136517.us-east-1.elb.amazonaws.com:80/login " but it fails.. I get a 503 Service Unavailable: Back-end server is at capacity as Response. POST请求现在可以执行到负载均衡器的DNS,例如“ http://awseb-em-AWSEBLoa-VVP8D98KT5SX-219136517.us-east-1.elb.amazonaws.com:80/login ”,但它失败。.我得到503服务不可用:后端服务器的容量为响应。 My question is, how to correctly configure a load balancer in this case? 我的问题是,在这种情况下如何正确配置负载均衡器? or How to move from a single instance to a load balancer and make this work? 或如何从单个实例移至负载均衡器并使其工作?
The load balancer configuration: 负载均衡器配置:
The problem occurs because the load balancer of aws only sends traffic to the instance that is healthy, otherwise it does not, therefore I had to configure the way I want the health of my instances to be checked. 发生问题是因为aws的负载均衡器仅将流量发送到运行状况良好的实例,否则不会发送流量,因此我必须配置希望检查实例状况的方式。 In this way the problem was solved. 这样就解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.