如何将aws ec2实例注册到ecs集群(不使用aws控制台)?

时间:2017-02-03 15:09:57

标签: amazon-web-services amazon-ec2 aws-sdk

我无法使用python boto3库中的register_container_instance将以前创建的ec2实例注册到集群中:

response = client.register_container_instance(
    cluster=cluster_name,
    instanceIdentityDocument='inst_id_doc.txt',
    instanceIdentityDocumentSignature='inst_id_sign.txt' 
)

我收到以下错误:

`traceback(most recent call last)import boto3
File "whetstone_2.py", line 79 in <module>
instanceIdentityDocumentSignature='inst_id_sign.txt'
File "C:\Users\ishanigh\Anaconda3\lib\site-packages\botocore\client.py",line 251, in _api_call
    return self._make_api_call(operation_name,kwargs)
File "C:\Users\ishanigh\Anaconda3\lib\site-packages\botocore\client.py",line 251, in _api_call
    raise ClientError(parsed_response,operation_name)
botocore.exceptions.clientError: An error occurred (ServerException)

调用RegisterContainerInstance操作时(达到最大重试次数:4):服务不可用。请稍后再试。 我从实例中获取了instance_id_doc.txt和inst_id_sign.txt。注册容器实例的过程必须自动化。 该怎么做?

0 个答案:

没有答案