在弹性 beantalk 部署中安装 EFS 卷失败

在弹性 beantalk 部署中安装 EFS 卷失败

我正在尝试学习在 Elastic beanstalk 上部署。我正在关注这个文档使用负载均衡器部署 WordPress 应用程序。应用程序部署不断失败并出现此错误

[Instance: i-<instance-id>] Command failed on instance.

Return code: 1 Output: (TRUNCATED)...fs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 <efs-id>.efs.us-east-2.amazonaws.com:/ /wpfiles mount.nfs4:

Failed to resolve server <efs-id>.efs.us-east-2.amazonaws.com: Name or service not known

ERROR: Mount command failed!. command 01_mount in .ebextensions/efs-mount.config failed.

似乎正在创建 EFS 卷,但尚未挂载。挂载失败的原因可能是什么?

答案1

对我来说,这是在自定义 VPC 中,我需要在该 VPC 中启用 DNS 主机名解析。EC2 实例需要能够解析 EFS 端点名称,如果在 VPC 中未启用此设置,则实例无法解析该名称。

我用来排除答案故障的文档是这份 AWS 文档。 https://docs.aws.amazon.com/efs/latest/ug/troubleshooting-efs-mounting.html#mount-fails-dns-name

并且可以在控制台或 CLI 中完成在 VPC 中启用 DNS 主机名解析的设置,此处记录了该设置。

https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames

相关内容