AWS Elastic Container Service - 여러 가용 영역에서 서비스 실행

AWS Elastic Container Service - 여러 가용 영역에서 서비스 실행

ECS를 통해 장기 실행 작업을 실행하고 있습니다. 컨테이너 인스턴스는 여러 가용성 영역에 분산되어 있습니다. 하나 이상의 작업 인스턴스가 있는 경우 각 작업이 다른 가용 영역에서 실행되어야 한다고 ECS에서 정의할 수 있습니까(가능한 경우)? 이 기능은 고가용성 및 내결함성에 매우 유용합니다. 지금은 작업의 5개 인스턴스가 모두 동일한 컴퓨터에서 실행될 수 있으므로 컴퓨터가 종료되면 작업이 모두 스케줄러에 의해 다른 곳에 배치되어야 하며 이로 인해 서비스가 중단될 수 있습니다.

당신이 나를 도울 수 있기를 바랍니다.

답변1

오늘 AZ 인식 일정이 발표되었으므로 이제 해결되었습니다.

아마존 블로그 게시물

답변2

나는 같은 문제에 직면하고 있습니다.

현재 저는 docker 및 awscli와 함께 자체 AMI를 사용하고 있습니다. ec2_Data를 사용하여 초기화 스크립트를 삽입합니다. 이 스크립트는 dockers를 실행하고 crontab(Cloudwatch 지표 및 백업용)을 적용하고 경보를 초기화합니다.

개인 레지스트리나 dockerhub를 사용하고 싶지 않습니다. S3에서 docker 이미지를 로드하고 있습니다.

s3curl --id clouddocker -- -s --retry 5 --retry-delay 30 URL.gz | gunzip|docker load

답변3

ecs-cli를 사용하면 서브넷을 정의할 수 있습니다.

>ecs-cli up --help
NAME:
   up - Create the ECS Cluster (if it does not already exist) and the AWS resources required to set up the cluster.

USAGE:
   command up [command options] [arguments...]

OPTIONS:
   --keypair        Specify the name of an existing Amazon EC2 key pair to enable SSH access to the EC2 instances in your cluster.
   --capability-iam Acknowledge that this command may create IAM resources.
   --size       [Optional] Specify the number of instances to register to the cluster. The default is 1.
   --azs        [Optional] Specify a comma-separated list of 2 VPC availability zones in which to create subnets (these AZs must be in the 'available' status). This option is recommended if you do not specify a VPC ID with the --vpc option. WARNING: Leaving this option blank can result in failure to launch container instances if an unavailable AZ is chosen at random.
   --security-group     [Optional] Specify an existing security group to associate it with container instances. Defaults to creating a new one.
   --cidr       [Optional] Specify a CIDR/IP range for the security group to use for container instances in your cluster. Defaults to 0.0.0.0/0 if --security-group is not specified
   --port       [Optional] Specify a port to open on a new security group that is created for your container instances if an existing security group is not specified with the --security-group option. Defaults to port 80.
   --subnets        [Optional] Specify a comma-separated list of existing VPC Subnet IDs in which to launch your container instances. This option is required if you specify a VPC with the --vpc option.
   --vpc        [Optional] Specify the ID of an existing VPC in which to launch your container instances. If you specify a VPC ID, you must specify a list of existing subnets in that VPC with the --subnets option. If you do not specify a VPC ID, a new VPC is created with two subnets.
   --instance-type  [Optional] Specify the EC2 instance type for your container instances.

관련 정보