我设法关注https://aws.amazon.com/blogs/compute/amazon-ecs-and-docker-volume-drivers-amazon-ebs/ 并使用 rex-ray Docker 在 ECS 上运行我的基于容器的服务音量插件。通过使用登录到 Docker 容器,我可以看到我的服务正在卷内生成数据docker exec -it <id> /bin/sh
主机 EC2 实例上是否有可以检查该数据的位置?rex-ray 卷是否安装在主机实例的任何位置?
我正在运行一个单节点 ECS 集群。我使用了以下任务定义。我在卷下的主机中声明了 sourcePath,但在主机容器上看不到任何输出目录。
{
"ipcMode": null,
"executionRoleArn": null,
"containerDefinitions": [
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/ecs/xxxxx",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
}
},
"entryPoint": null,
"portMappings": [],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "save_path",
"value": "/outputs"
},
{
"name": "watchdog_limit",
"value": "60"
},
{
"name": "max_records_per_file",
"value": "14400"
}
],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [
{
"readOnly": null,
"containerPath": "/outputs",
"sourceVolume": "rexray_volume"
}
],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": null,
"memoryReservation": 300,
"volumesFrom": [],
"stopTimeout": null,
"image": "xxxxxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/xxxxxxxxx:1.1",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "Datafeed"
}
],
"memory": null,
"taskRoleArn": null,
"family": "Xxxxxxxx",
"pidMode": null,
"requiresCompatibilities": [
"EC2"
],
"networkMode": null,
"cpu": null,
"inferenceAccelerators": [],
"proxyConfiguration": null,
"volumes": [
{
"fsxWindowsFileServerVolumeConfiguration": null,
"efsVolumeConfiguration": null,
"name": "rexray_volume",
"host": {
"sourcePath": "/outputs"
},
"dockerVolumeConfiguration": {
"autoprovision": true,
"scope": "shared",
"driver": "rexray/ebs",
"driverOpts": {
"volumetype": "gp3",
"size": "20"
}
}
}
],
"placementConstraints": [],
"tags": []
}