ECS container application fails and is restarted but restart is unsuccessful

0

I am deploying a container application using copilot with a manifest file that specifies a health check and service count of 2. The initial deployment is successful with 2 services running and load balancing is working. When one of the two services fail, a restart of the service occurs as expected, but it is immediately declared unhealthy and is terminated and the restart procedure is repeated with the same result. The second copy of the service is never successfully restarted. I did not experience this problem 6 months ago. What suggestion do you to trouble shoot this problem? David W.

DavidW
질문됨 7달 전292회 조회
3개 답변
0

Hello.

If you check the container logs, you might be able to find out why it doesn't start properly.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html

You can also check the reason for the stopped task by following the steps in the document below.
https://docs.aws.amazon.com/AmazonECS/latest/userguide/stopped-task-errors.html

profile picture
전문가
답변함 7달 전
0

Hello, Firstly need to verify logs and events inside services.inside services event we can find each event when anything happens. Also verify cloudwatch logs if any thing bad happening regarding application.

Also please verify target group configuration regarding health check monitoring settings.

profile picture
답변함 7달 전
0

The application is a Java Spring application. The cloudwatch logs show the Spring server starting with no errors, and then there is a shutdown message. There is no console log message that indicates an error or why the server is shutdown. This is likely because the process was terminated by an external interrupt.

Some other information, if the ECS service continues for some 5-10 minutes, after 5 attempts at restarting the failed container only for the restarted container to be marked UNHEALTHY and thereby terminated, the container does finally do a restart and is reported as HEALTHY.

Satish's answer says to verify the target group configuration for health check monitoring settings. I am not sure exactly what this refers to or how to do this. In the manifest.yml file used for deployment of the container into ECS, the settings are

------------------------------------------------- manifest.yml for service cst438service -------------------------------------------------- name: cst438service

type: Load Balanced Web Service

http:

path: '/'

healthcheck: '/check'

interval: 300

image:

build: cst438container/Dockerfile

port: 80

cpu: 256 # Number of CPU units for the task.

memory: 512 # Amount of memory in MiB used by the task.

count: 2 # Number of tasks that should be running in your service.

exec: true # Enable running commands in your container.


David

DavidW
답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠