2016-08-23 262 views
0

我有一個註冊到Amazon ECS羣集的Amazon EC2實例。更改已註冊EC2實例的羣集的實例類型

而且我想將此實例的類型從c4.large更改爲c4.8xlarge

我可以在AWS控制檯中將其類型從c4.large更改爲c4.8xlarge。但改變後,我發現

[ERROR] Could not register module="api client" err="ClientException: Container instance type changes are not supported. Container instance XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX was previously registered as c4.large.

被印在/var/log/ecs/ecs-agent.log.20XX-XX-XX-XX文件。

是否可以更改ec2實例類型並將其重新註冊到集羣?

我想也許先註銷它,然後再註冊它應該工作。但是我擔心這可能會導致我的AWS工作環境中出現不可逆轉的情況。所以我還沒有嘗試過這種方法。

+0

您是否聯繫aws獲取此功能?如果它不支持您的預期? – BMW

回答

0

你不能這樣做。 Per their docs

The type of EC2 instance that you choose for your container instances determines the resources available in your cluster. Amazon EC2 provides different instance types, each with different CPU, memory, storage, and networking capacity that you can use to run your tasks. For more information, see Amazon EC2 Instances.

這意味着,當你對一個實例啓動容器,該代理收集一堆的元數據的有關實例來運行它。如果你改變它,那麼所有的元數據(或很多)都會以一種不好的方式發生變化。 CPU單元,內存等。代理知道這and will report it as an error

您應該啓動新類型的新實例並將其註冊到羣集並讓任務在其上運行。如果它是一個服務,只需要終止舊的實例並讓它針對新的實例運行。

我想不出任何真正原因終止舊的實例會導致不可逆轉的東西,除非它是通過用戶特定的設置配置錯誤或脆弱的,默認情況下,這會不會造成任何破壞性。