Amazon ECS에서 "The managed termination protection setting for the capacity provider is invalid" 오류를 해결하려면 어떻게 해야 합니까?

3분 분량
0

Amazon ECS(Amazon Elastic Container Service)에서 클러스터 용량 공급자를 생성하려고 하면 "The managed termination protection setting for the capacity provider is invalid. To enable managed termination protection for a capacity provider, the Auto Scaling group must have instance protection from scale in enabled." 오류가 나타납니다. 이 오류를 해결하려면 어떻게 해야 합니까?

해결 방법

오류를 해결하려면 Auto Scaling 그룹에서 축소 보호를 활성화합니다. Amazon EC2(Amazon Elastic Compute Cloud) 콘솔 또는 AWS CLI(AWS 명령줄 인터페이스)를 사용하여 축소 보호를 활성화할 수 있습니다.

참고: AWS CLI 명령을 실행할 때 오류가 발생하는 경우 최신 버전의 AWS CLI를 사용하고 있는지 확인하세요.

Amazon EC2 콘솔 사용

1.    Amazon EC2 콘솔을 열고 탐색 창에서 **Auto Scaling 그룹(Auto Scaling Groups)**을 선택합니다.

2.    원하는 Auto Scaling 그룹을 선택합니다. 세부 정보(Details) 탭에서 **고급 구성(Advanced configurations)**으로 스크롤한 다음 **편집(Edit)**을 선택합니다.

3.    **인스턴스 축소 보호(Instance scale-in protection)**에서 **인스턴스 축소 보호 활성화(Enable instance scale-in protection)**를 선택합니다.

4.    **업데이트(Update)**를 선택합니다.

AWS CLI 사용

AWS CLI를 사용하여 Auto Scaling 그룹에 대한 축소 보호를 활성화하려면 다음 명령을 실행합니다.

aws autoscaling update-auto-scaling-group \
    --region RegionID \
    --auto-scaling-group-name yourASGName \
    --new-instances-protected-from-scale-in

참고: RegionID를 사용 중인 AWS 리전으로 바꿉니다. yourASGName을 Auto Scaling 그룹의 이름으로 바꿉니다.

문제 해결

그래도 오류가 발생하면, Auto Scaling 그룹에서 시작한 기존 인스턴스 중 일부에 축소 보호 기능이 없는 것일 수 있습니다.

Amazon EC2 콘솔 또는 AWS CLI를 사용하여 나머지 인스턴스에 축소 보호를 적용하려면 다음 단계를 따르십시오.

Amazon EC2 콘솔 사용

1.    Amazon EC2 콘솔을 열고 탐색 창에서 **Auto Scaling 그룹(Auto Scaling Groups)**을 선택합니다.

2.    Auto Scaling 그룹을 선택한 다음 인스턴스(Instances) 탭을 선택합니다.

3.    인스턴스 ID(Instance ID) 열에서 축소 보호를 적용할 인스턴스를 선택합니다.

4.    인스턴스 관리(Instance management) 탭에서 동작(Actions), **축소 보호 설정(Set scale-in protection)**을 선택합니다.

5.    Amazon ECS에서 용량 공급자를 생성합니다.

AWS CLI 사용

Auto Scaling 그룹에서 축소 보호가 활성화되지 않은 인스턴스를 나열하려면 쿼리 기능을 사용하여 다음 AWS CLI 명령을 실행합니다.

aws autoscaling describe-auto-scaling-groups \
    --region RegionID \
    --auto-scaling-group-names yourASGName \
    --query 'AutoScalingGroups[].Instances[?ProtectedFromScaleIn==`true`].{Id:InstanceId}' \
    --output text

참고: RegionID를 사용 중인 AWS 리전으로 바꿉니다. yourASGName을 Auto Scaling 그룹의 이름으로 바꿉니다.

그런 다음 Auto Scaling 그룹에서 지정된 인스턴스에 대해 축소 보호를 활성화하려면 다음 단계를 따르십시오.

1.    다음 명령을 실행합니다.

aws autoscaling set-instance-protection \
    --region RegionID \
    --instance-ids yourInstanceID \
    --auto-scaling-group-name yourASGName \
    --protected-from-scale-in

참고: RegionID를 사용 중인 AWS 리전으로 바꿉니다. yourInstanceID를 인스턴스 ID로 바꿉니다. yourASGName을 Auto Scaling 그룹의 이름으로 바꿉니다. 2.    Amazon ECS에서 용량 공급자를 생성합니다.


관련 정보

아마존 ECS 클러스터 Auto Scaling

AWS 공식
AWS 공식업데이트됨 3년 전