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

Cyr*_*our 5 django amazon-web-services amazon-elastic-beanstalk

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

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

DBSubnets:无效的选项值:'["subnet-3dbb9564","subnet-b2edb199"]'(命名空间:'aws:ec2:vpc',OptionName:'DBSubnets'):指定VPC ID并确保所有子网都存在.

使用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.
Run Code Online (Sandbox Code Playgroud)

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

Nav*_*M S 7

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

eb create --database.engine postgres.

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

错误:操作超时.环境状况未知.

收到此错误后,您只需添加,提交和eb部署项目.使用此方法我成功将Django项目部署到AWS,我的.ebextensions容器命令添加到01_packages.config下面

packages:
  yum:
    git: []
    libffi-devel: []
    python27-devel: []
    postgresql93: []
    postgresql93-devel: []
    gcc-c++: []
Run Code Online (Sandbox Code Playgroud)

首先添加上面的配置并设置正确的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"
Run Code Online (Sandbox Code Playgroud)


Dan*_*anH 0

您似乎尚未在 AWS 中创建 DBSubnet。

您是否为所有相关可用区域创建了 DBSubnet?如以下链接的步骤 3 中所述?

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo-vpc-rds.html#AWSHowTo-vpc-rds-subnet

创建数据库子网组

  1. 打开 Amazon RDS 控制台https://console.aws.amazon.com/rds/

  2. 在导航窗格中,单击子网组。

  3. 单击创建数据库子网组。

  4. 单击名称,然后键入数据库子网组的名称。

  5. 单击描述,然后描述您的数据库子网组。

  6. 在 VPC ID 旁边,选择您创建的 VPC 的 ID。

  7. 单击“将子网添加到此子网组”部分中的“添加所有子网”链接。

  8. 完成后,单击是,创建
  9. 在确认窗口中,单击“关闭”。