我使用 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/