Web app working in an EC2 instance but not in another

0

I have built a Python web app that accepts requests through GatewayAPI and sieves them via Lambda functions and SQS. The app also uses Redis and is deployed using an EC2 instance connected to Lambda functions via Load Balancers and Target Groups. Currently, the app is working perfectly as expected. However, when I deploy the same app into a different EC2 instance with the same specs and connect them to the same Lambda functions via different instances Load Balancer and Target Group, it fails to work properly despite having received the correct requests. The two EC2 instances use the same Redis server although with a different key. I have debugged every line of my code and still can't seem to find what or where the bug is. I am almost sure that I am doing something wrong on the AWS end. Could anyone help with where things might have gone wrong?

1 回答
0

Hi - I would recommend to do the following and find what is happening at each layer based on how you have set up your logs.

  1. Look into your application logs and resources logs. Some of these logs may be your custom logs and some of them would be in cloudwatch
  2. For your lambda functions you can check cloudwatch logs for the same. Reference : https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html
  3. If you are using API gateway then you can also look into cloudwatch logs Reference : https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-cloudwatch-logs/
  4. You can also access logs for your Application Load Balancer. Reference : https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html

Essentially look at the logs should provide where the issue is happening like any network timeout, data error, internal error, system exception etc.

profile pictureAWS
专家
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则