简体   繁体   English

如何在AWS Elastic Beanstalk环境中配置负载均衡器?

[英]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.

相关问题 如何使用CLI配置Elastic beanstalk经典负载均衡器以终止HTTPS - How to configure Elastic beanstalk classic load balancer to terminate HTTPS using the CLI 如何在没有负载均衡器的情况下为 HTTPS 在 Elastic Beanstalk 上配置 Springboot 后端服务器 - How to configure Springboot backend server on Elastic Beanstalk for HTTPS without load balancer 部署到AWS Elastic Beanstalk后如何访问servlet? - How do I access servlets after deploying to AWS Elastic Beanstalk? AWS-带$的Elastic Beanstalk环境属性 - AWS - Elastic Beanstalk Environment properties with a $ 如何从适用于Java的AWS开发工具包克隆Elastic Beanstalk环境? - How can I clone an Elastic Beanstalk environment from the AWS SDK for Java? 如何从aws弹性beanstalk环境中获取堆转储 - How to get heap dump from aws elastic beanstalk environment AWS Elastic Beanstalk 环境变量编码和字符集 - AWS Elastic Beanstalk environment variable encoding and charset 如何使用 AWS CLI 2 将更新的 JAR 上传到现有的 Java Elastic Beanstalk 实例? - How do I upload an updated JAR to an existing Java Elastic Beanstalk instance using the AWS CLI 2? 如何在Elastic Beanstalk上为Amazon SES传递AWS_ACCESS_KEY_ID? - How do I pass AWS_ACCESS_KEY_ID for Amazon SES on Elastic Beanstalk? 如何从Spring Java Elastic Beanstalk应用程序连接到我的AWS DynamoDB实例? - How do I connect to my AWS DynamoDB instance from a Spring Java Elastic Beanstalk app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM