amazon-web-services - 启动 EC2 实例时看不到 EFS 文件

标签 amazon-web-services amazon-ec2 amazon-efs

我使用 EFS 作为存储解决方案。我在一个实例上安装了 EFS 并向它上传了一些文件。当我在其他实例上安装 EFS 时,我可以看到我上传的文件,但是当我在启动期间将 EFS 添加到 EC2 实例时,我看不到这些文件。
可能是什么问题?
更新:我跑了 df -h命令,结果是

Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        482M     0  482M   0% /dev
tmpfs           492M     0  492M   0% /dev/shm
tmpfs           492M  416K  492M   1% /run
tmpfs           492M     0  492M   0% /sys/fs/cgroup
/dev/xvda1      8.0G  1.5G  6.6G  18% /
tmpfs            99M     0   99M   0% /run/user/1000
所以文件系统没有被挂载,我在启动期间使用 aws 管理控制台添加了它。我究竟做错了什么?

最佳答案

您一定忘记单击添加用户数据,它会自动为 efs 挂载点添加脚本,生成在初始引导过程中使用的用户数据脚本来设置 EFS 挂载,并在重新启动后保持它们

click Add to User Data, which will generate a user data script used during the initial boot process to setup the EFS mounts, and persist them across reboots. Click Advanced Details to see the User Data generated by your file system selections.


更多详情请关注 docs
甚至这个博客也用截图来告诉你什么命令是自动添加的单击添加用户数据 https://aws.amazon.com/blogs/storage/automate-mounting-amazon-efs-file-systems-from-the-ec2-launch-instance-wizard/

you have 2 options to deal with this problem, either relaunch your instance and add user data or mount efs manually by sshing into your instance using nfs client

关于amazon-web-services - 启动 EC2 实例时看不到 EFS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68002729/

相关文章:

amazon-ec2 - 如何使用 CloudFormation 将 UserData 传递到 Beanstalk 实例

amazon-web-services - 通过 Cloudformation 将 EFS ID 传递给 OpsWorks

terraform - 使用 Terraform 将 EFS 挂载到 AWS Fargate - PlatformTaskDefinitionIncompatibilityException 错误 :

python - 云形成 : Pass List to Lambda Function

node.js - 在 AWS EC2 Ubuntu 实例上通过 iptables 重定向端口

amazon-web-services - 从管理器检索 secret 并在 ec2 cfn-init 中使用它

amazon-web-services - AWS efs 挂载权限被拒绝

sql - 本地计算机上的 Hadoop/Hive : Loading data from . csv

linux - 如何在linux中使用while循环来检查条件?

linux - 亚马逊 ec2 boto 返回空实例