我正在ECS集群上運行一個Docker鏡像,以便對其進行加殼并運行一些簡單的測驗。然而,當我運行這個:
aws ecs execute-command
--cluster MyEcsCluster
--任務 $ECS_TASK_ARN
--container MainContainer
--命令"/bin/bash"
--互動式
我得到的錯誤是:
會話管理器插件已成功安裝。使用AWS CLI來啟動會話。
在呼叫 ExecuteCommand 操作時發生了一個錯誤(TargetNotConnectedException)。由于內部錯誤,執行命令失敗。稍后再試。
我可以確認任務 容器 代理都在運行:
我可以確認任務 容器 代理都在運行。
aws ecs describe-tasks
--cluster MyEcsCluster
--任務 $ECS_TASK_ARN
| jq '.'
"容器": [/span>
{>
"containerArn": "<redacted>",
"taskArn": "<redacted>",/span>
"name": "MainContainer",
"image": "confluentinc/cp-kafkacat",/span>
"runtimeId": "<redacted>", "<redacted;"
"lastStatus": "RUNNING",
"networkBindings": [],
"networkInterfaces": [/span>
{
"attachmentId": "<redacted>",
"privateIpv4Address": "<reddacted>"
}
],
"healthStatus": "UNKNOWN",
"managedAgents": []。
{
"lastStartedAt": "2021-09-20T16:26:44.540000-05:00",
"name": "ExecuteCommandAgent",
"lastStatus": "RUNNING"/span>
}
],
"cpu": "0",
"記憶體": "4096"
}
],
我正在用CDK Typescript代碼定義ECS集群和任務定義:
new Cluster( stack, `MyEcsCluster`, {
vpc。
clusterName: `MyEcsCluster`,
})
const taskDefinition = new FargateTaskDefinition( stack, TestTaskDefinition`, {
family: `TestTaskDefinition`。
cpu: 512,
memoryLimitMiB: 4096,
})
taskDefinition.addContainer("MainContainer", {
影像。ContainerImage.fromRegistry("confluentinc/cp-kafkacat")。
命令。["tail", "-F", "/dev/null"]。
memoryLimitMiB: 4096,
// 一些互聯網搜索建議設定這個標志。這似乎并沒有什么幫助。
readonlyRootFilesystem: false,
})
uj5u.com熱心網友回復:
這個工具應該可以找出你的設定有什么問題。你可以試一試嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/332537.html
標籤:
