gpt4 book ai didi

amazon-web-services - 实例重启后,Amazon OpsWorks 未安装 EBS 卷?

转载 作者:行者123 更新时间:2023-12-02 04:34:11 24 4
gpt4 key购买 nike

我已经配置了一个 OpsWorks 堆栈并设置了我的层,以便将 50 GB 的卷附加到我启动的每个实例。

一个新的 EBS 卷被正确地创建、附加和装载到新启动的实例。这是我在第一次启动后立即看到的:

[root@biscotti ec2-user]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.9G 1.9G 5.9G 25% /
tmpfs 298M 0 298M 0% /dev/shm
/dev/xvdi 50G 33M 50G 1% /srv/www <---------
[root@biscotti ec2-user]# mount
/dev/xvda1 on / type ext4 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/xvdi on /srv/www type xfs (rw,noatime) <---------

但是,如果我重启实例,卷将不会自动重新挂载:

[root@biscotti ec2-user]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.9G 1.9G 5.9G 25% /
tmpfs 298M 0 298M 0% /dev/shm
[root@biscotti ec2-user]# mount
/dev/xvda1 on / type ext4 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

如果我输入

sudo mount -a

一切都会恢复正常:

[root@biscotti ec2-user]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.9G 1.9G 5.9G 25% /
tmpfs 298M 0 298M 0% /dev/shm
/dev/xvdi 50G 33M 50G 1% /srv/www
[root@biscotti ec2-user]# mount
/dev/xvda1 on / type ext4 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/xvdi on /srv/www type xfs (rw,noatime)

如何让 OpsWorks 自动为我重新挂载 EBS 卷?

提前致谢。

最佳答案

我向 AWS 支持提出了这个问题,结果证明是 OpsWorks 的问题。要使错误重现,一件至关重要的事情是我通过在命令行上键入 sudo reboot 来重启实例。如果我改为通过 API 或 AWS 控制台停止并重新启动实例,则卷会正确安装。从字面上引用 AWS 支持:

OpsWorks is a very procedural service. It likes to manage its own resources without manual intervention if at all possible. Perhaps the manual OS reboot is overriding some part of the OpsWorks process.

我被告知 OpsWorksdev 团队正在解决这个问题。该问题也可以通过在带有自定义 Chef 配方的 /etc/fstab 文件中向 EBS 设备添加 auto 选项来解决。

希望对遇到同样问题的人有所帮助。

关于amazon-web-services - 实例重启后,Amazon OpsWorks 未安装 EBS 卷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22331845/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com