With one instance started, wait for it to run and register in the cluster. Then if you
describe
the
cluster again, you will see that the default cluster has switched to active
state. You can also list container instances:
$
aws ecs describe-clusters
---------------------------------------------------------------------------------
| DescribeClusters |
+-------------------------------------------------------------------------------+
|| clusters ||
|+-----------------------------------------------------+--------------+--------+|
|| clusterArn | clusterName | status ||
|+-----------------------------------------------------+--------------+--------+|
|| arn:aws:ecs:us-east-1:587432148683:cluster/default | default | ACTIVE ||
|+-----------------------------------------------------+--------------+--------+|
$ aws
ecs list-container-instances
--------------------------------------------------------------------------------
| ListContainerInstances |
+------------------------------------------------------------------------------+
|| containerInstanceArns ||
|+----------------------------------------------------------------------------+|
|| arn:aws:ecs:us-east-1:541234428683:container-instance/ ... ||
|+----------------------------------------------------------------------------+|
Starting additional instances increases the size of the cluster:
$ aws ecs list-container-instances
--------------------------------------------------------------------------
| ListContainerInstances |
+------------------------------------------------------------------------+
|| containerInstanceArns ||
|+----------------------------------------------------------------------+|
|| arn:aws:ecs:us-east-1:587342368683:container-instance/75738343-... ||
|| arn:aws:ecs:us-east-1:587423448683:container-instance/b457e535-... ||
|| arn:aws:ecs:us-east-1:584242468683:container-instance/e5c0be59-... ||
|| arn:aws:ecs:us-east-1:587421468683:container-instance/e62d3d79-... ||
|+----------------------------------------------------------------------+|
Since these container instances are regular EC2 instances, you will see them in your
EC2 console. If you have set up an SSH key properly and opened port 22 on the secu‐
rity
group used, you can also
ssh
to them:
$ ssh -i ~/.ssh/id_rsa_ecs ec2-user@52.1.224.245
...
__| __| __|
_| ( \__ \ Amazon ECS-Optimized
Amazon Linux AMI
____|\___|____/
Image created: Thu Dec 18 01:39:14 UTC 2014
PREVIEW AMI
9 package(s) needed for security, out of 10 available
Do'stlaringiz bilan baham: