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

时间:2022-08-25 09:02:01

After using eb create to create a new environment, I am unable to create a new RDS database inside my environment using AWS console. It required me to select at least at least two availability zones from a list of four.

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

whichever I select I get the error:

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

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

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

Using EB CLI with the following command eb create --database.engine postgres, I get a timeout.

使用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.

What other options do I have. Is this a problem from AWS side?

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

4 个解决方案

#1


7  

I deployed Django application successfully using this command

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

eb create --database.engine postgres.

eb create --database.engine postgres。

Once applied the above command you will get an error as follows

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

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

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

after getting this error you just git add,commit and eb deploy the project. Using this method i successfully deployed Django project to AWS my .ebextensions container commands are added below 01_packages.config

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

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

first add the above configuration and set proper wsgi path and set proper RDS configuration in your settings.py.Then add, commit and deploy.After this add the configuration below and deploy

首先添加上面的配置并设置正确的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"

#2


1  

I had the same error message as you when using the EB CLI but upon checking the AWS web console, it seems like the database was successfully created in the environment.

我在使用EB CLI时遇到了与您相同的错误消息,但在检查AWS Web控制台时,似乎已在环境中成功创建了数据库。

#3


1  

In regards to not being able to create the database from the Elastic Beanstalk console (your first question) it appears that this is an AWS problem. According to this post, it is a known bug that they will hopefully fix.

关于无法从Elastic Beanstalk控制台创建数据库(您的第一个问题),这似乎是一个AWS问题。根据这篇文章,这是一个众所周知的错误,他们希望能够修复。

This looks like an issue with our console with certain RDS DB instance types We will be working on a fix, but in the meantime please try a different RDS DB instance type or use the EB CLI to create your environment with an RDS DB. Here is the link to the docs for the EB Create command with the --database option: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html

这看起来像我们的控制台与某些RDS数据库实例类型的问题我们将进行修复,但同时请尝试不同的RDS数据库实例类型或使用EB CLI创建具有RDS DB的环境。以下是使用--database选项的EB Create命令的文档链接:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html

I tried with multiple instance types and was not able to create it through the console. I ended up creating a separate RDS instance and connecting to that. Here is a post that had interesting points about connecting to an existing database.

我尝试了多种实例类型,但无法通过控制台创建它。我最终创建了一个单独的RDS实例并连接到它。这篇文章有关于连接现有数据库的有趣观点。

#4


0  

Appears that you may not have created your DBSubnets in AWS.

似乎您可能尚未在AWS中创建DBSubnets。

Have you created your DBSubnets for all relevant availability zones? as described in step 3 of the below link?

您是否为所有相关可用区创建了DBSubnets?如下面链接的第3步所述?

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

Create a DB subnet group

创建数据库子网组

  1. Open the Amazon RDS console at https://console.aws.amazon.com/rds/.

    通过以下网址打开Amazon RDS控制台:https://console.aws.amazon.com/rds/。

  2. In the navigation pane, click Subnet Groups.

    在导航窗格中,单击“子网组”。

  3. Click Create DB Subnet Group.

    单击“创建数据库子网组”。

  4. Click Name, and then type the name of your DB Subnet Group.

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

  5. Click Description, and then describe your DB Subnet Group.

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

  6. Next to VPC ID, select the ID of the VPC that you created.

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

  7. Click the add all the subnets link in the Add Subnet(s) to this Subnet Group section.

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

  8. When you are finished, click Yes, Create
  9. 完成后,单击“是,创建”

  10. In the confirmation window, click Close.
  11. 在确认窗口中,单击“关闭”。

#1


7  

I deployed Django application successfully using this command

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

eb create --database.engine postgres.

eb create --database.engine postgres。

Once applied the above command you will get an error as follows

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

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

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

after getting this error you just git add,commit and eb deploy the project. Using this method i successfully deployed Django project to AWS my .ebextensions container commands are added below 01_packages.config

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

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

first add the above configuration and set proper wsgi path and set proper RDS configuration in your settings.py.Then add, commit and deploy.After this add the configuration below and deploy

首先添加上面的配置并设置正确的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"

#2


1  

I had the same error message as you when using the EB CLI but upon checking the AWS web console, it seems like the database was successfully created in the environment.

我在使用EB CLI时遇到了与您相同的错误消息,但在检查AWS Web控制台时,似乎已在环境中成功创建了数据库。

#3


1  

In regards to not being able to create the database from the Elastic Beanstalk console (your first question) it appears that this is an AWS problem. According to this post, it is a known bug that they will hopefully fix.

关于无法从Elastic Beanstalk控制台创建数据库(您的第一个问题),这似乎是一个AWS问题。根据这篇文章,这是一个众所周知的错误,他们希望能够修复。

This looks like an issue with our console with certain RDS DB instance types We will be working on a fix, but in the meantime please try a different RDS DB instance type or use the EB CLI to create your environment with an RDS DB. Here is the link to the docs for the EB Create command with the --database option: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html

这看起来像我们的控制台与某些RDS数据库实例类型的问题我们将进行修复,但同时请尝试不同的RDS数据库实例类型或使用EB CLI创建具有RDS DB的环境。以下是使用--database选项的EB Create命令的文档链接:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html

I tried with multiple instance types and was not able to create it through the console. I ended up creating a separate RDS instance and connecting to that. Here is a post that had interesting points about connecting to an existing database.

我尝试了多种实例类型,但无法通过控制台创建它。我最终创建了一个单独的RDS实例并连接到它。这篇文章有关于连接现有数据库的有趣观点。

#4


0  

Appears that you may not have created your DBSubnets in AWS.

似乎您可能尚未在AWS中创建DBSubnets。

Have you created your DBSubnets for all relevant availability zones? as described in step 3 of the below link?

您是否为所有相关可用区创建了DBSubnets?如下面链接的第3步所述?

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

Create a DB subnet group

创建数据库子网组

  1. Open the Amazon RDS console at https://console.aws.amazon.com/rds/.

    通过以下网址打开Amazon RDS控制台:https://console.aws.amazon.com/rds/。

  2. In the navigation pane, click Subnet Groups.

    在导航窗格中,单击“子网组”。

  3. Click Create DB Subnet Group.

    单击“创建数据库子网组”。

  4. Click Name, and then type the name of your DB Subnet Group.

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

  5. Click Description, and then describe your DB Subnet Group.

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

  6. Next to VPC ID, select the ID of the VPC that you created.

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

  7. Click the add all the subnets link in the Add Subnet(s) to this Subnet Group section.

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

  8. When you are finished, click Yes, Create
  9. 完成后,单击“是,创建”

  10. In the confirmation window, click Close.
  11. 在确认窗口中,单击“关闭”。