AWS Elastic Container Service – Execute o serviço em várias zonas de disponibilidade

AWS Elastic Container Service – Execute o serviço em várias zonas de disponibilidade

Estou executando tarefas de longa duração via ECS. As instâncias de contêiner estão espalhadas por diversas zonas de disponibilidade. É possível definir no ECS que ao haver mais de 1 instância de uma tarefa, cada tarefa deverá ser executada em outra zona de disponibilidade (se possível)? Esse recurso seria incrível para alta disponibilidade e tolerância a falhas. No momento, seria possível que todas as minhas 5 instâncias de uma tarefa fossem executadas na mesma máquina; portanto, quando a máquina morrer, todas as tarefas precisariam ser colocadas em outro lugar pelo agendador e isso resultaria em tempo de inatividade do serviço.

Espero que você possa me ajudar.

Responder1

Hoje foi anunciado o agendamento com reconhecimento de AZ, então isso está resolvido agora

Postagem no blog da Amazon

Responder2

estou enfrentando o mesmo problema.

No momento, estou usando minha própria AMI com docker e awscli. Eu injeto o script de inicialização com ec2_Data. Este script inicia o dockersn, aplica crontabs (para métricas e backups do Cloudwatch) e inicializa alarmes.

Não quero usar um registro privado ou dockerhub, estou carregando imagens do docker do S3

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

Responder3

Com ecs-cli, você pode definir sub-redes.

>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.

informação relacionada