gpt4 book ai didi

django - 无法在 AWS Elastic Beanstalk 上创建新的 RDS 数据库

转载 作者:行者123 更新时间:2023-12-02 08:38:48 34 4
gpt4 key购买 nike

使用 eb create 创建新环境后,我无法使用 AWS 控制台在我的环境中创建新的 RDS 数据库。它要求我从四个可用区列表中至少选择两个可用区。

无论我选择哪一个,都会收到错误:

DBSubnets: Invalid option value: '["subnet-3dbb9564","subnet-b2edb199"]' (Namespace: 'aws:ec2:vpc', OptionName: 'DBSubnets'): Specify the VPC ID and make sure all subnets exist.

使用 EB CLI 和以下命令 eb create --database.engine postgres,出现超时。

Environment details for: iod-test
Application name: image_of_day2
Region: us-east-1
Deployed Version: 642b
Environment ID: e-u7q9j5ft2e
Platform: 64bit Amazon Linux 2015.03 v2.0.1 running Python 2.7
Tier: WebServer-Standard
CNAME: iotd-test2.elasticbeanstalk.com
Updated: 2015-09-21 19:29:37.262000+00:00
Printing Status:
INFO: createEnvironment is starting.
INFO: Using elasticbeanstalk-us-east-1-249541483051 as Amazon S3 storage bucket for environment data.
INFO: Created security group named: sg-7e948419
INFO: Environment health has transitioned to Pending. There are no instances.
INFO: Created security group named: awseb-e-u7q9j5ft2e-stack-AWSEBSecurityGroup-D0EHQ2UNQQWH
INFO: Created Auto Scaling launch configuration named: awseb-e-u7q9j5ft2e-stack-AWSEBAutoScalingLaunchConfiguration-FQZXDALSR4Z6
INFO: Created RDS database security group named: awseb-e-u7q9j5ft2e-stack-awsebrdsdbsecuritygroup-1xo7y4uzxrwgx
INFO: Creating RDS database named: aaaqgf0bktrtyg. This may take a few minutes.

ERROR: The operation timed out. The state of the environment is unknown.

我还有什么其他选择。这是AWS方面的问题吗?

最佳答案

我使用此命令成功部署了 Django 应用程序

eb create --database.engine postgres.

应用上述命令后,您将收到如下错误

ERROR: The operation timed out. The state of the environment is unknown.

收到此错误后,您只需 git add、commit 和 eb 部署项目即可。使用这种方法我成功地将Django项目部署到AWS我的 .ebextensions 容器命令添加在下面01_packages.config

packages:
yum:
git: []
libffi-devel: []
python27-devel: []
postgresql93: []
postgresql93-devel: []
gcc-c++: []

首先添加上述配置并设置正确的wsgi路径,并在settings.py中设置正确的RDS配置。然后添加、提交和部署。之后添加以下配置并部署

02_python.config

container_commands:
01_migrate:
command: "source /opt/python/run/venv/bin/activate && python /opt/python/current/app/manage.py migrate --noinput"
leader_only: true
02_collectstatic:
command: "source /opt/python/run/venv/bin/activate && python /opt/python/current/app/manage.py collectstatic --noinput"
leader_only: true
99_runscript:
command: "source /opt/python/run/venv/bin/activate && python /opt/python/current/app/manage.py runscript init_db"

关于django - 无法在 AWS Elastic Beanstalk 上创建新的 RDS 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32703525/

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