简体   繁体   中英

EFS mounts on ECS Fargate container platform on AWS and confirming it works?

I think I can mount a new EFS volume on my container because it gives me no errors. How do I verify if it is actually running or working and which container has it mounted. Does anyone know if there is a tool with the exception of building some library in my code to verify it.

Two possible option that you can try is

  • Mount EFS with EC2 and verify the content (Manual way of verification)
  • Add logic in the startup.sh the script in the container to verify the EFS integration (Automated)

suppose the mount point is

 "mountPoints": [
                {"containerPath": "/server",
                    "sourceVolume": "efs-server-AP"
                }
            ]

in a startup script, you can something like

# if this is the first time the server starts the config file is populated
mkdir -p /server
if [ ! -f /server/config.json ]; then 
echo "running first time"
echo ""running first time" > /server/config.json;
# generate some random file
echo $(date) > "$(date).txt"
else
echo "EFS working fine; list of file exist"
ls /server
fi

you can look into more details developers-guide-to-using-amazon-efs-with-amazon-ecs-and-aws-fargate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM