Amazon web services Rds_实例无法使用Ansible在Aurora群集内创建Rds数据库
我正在尝试创建一个带有1个writer/reader节点的Aurora DB集群 Ansible目前似乎不支持为Aurora创建集群,因此我使用AWS CLI创建集群Amazon web services Rds_实例无法使用Ansible在Aurora群集内创建Rds数据库,amazon-web-services,ansible,Amazon Web Services,Ansible,我正在尝试创建一个带有1个writer/reader节点的Aurora DB集群 Ansible目前似乎不支持为Aurora创建集群,因此我使用AWS CLI创建集群 #NOTE - Currently, Ansible does not support creating an RDS cluster in the official documentation. This may change in the future. - name: Create the DB cluster com
#NOTE - Currently, Ansible does not support creating an RDS cluster in the official documentation. This may change in the future.
- name: Create the DB cluster
command: >
aws rds create-db-cluster
--db-cluster-identifier production-db
--engine aurora-mysql
--db-subnet-group-name webserver-connections
--vpc-security-group-ids sg-dja17283
--storage-encrypted
--db-cluster-parameter-group-name my-parameter-group
--master-username "my_username"
--master-user-password "My_Password"
--backup-retention-period 7
when: aurora_cluster == ''
- name: Create instances inside of cluster
rds_instance:
engine: aurora
engine_version: "5.7.mysql_aurora.2.07.2"
db_instance_identifier: ansible-test-aurora-db-instance
instance_type: db.t2.small
cluster_id: production-db
multi_az: yes
storage_encrypted: yes
# backup_retention_period: 7
tags:
Environment: "Production"
这是回报-
"msg": "Unable to create DB instance: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: Cannot find version 5.7.mysql_aurora.2.07.2 for aurora",
如果我将引擎设置为auroramysql,我会看到以下内容-
"msg": "Unable to create DB instance: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: VPC Multi-AZ DB Instances are not available for engine: aurora-mysql"
"msg": "Unable to create DB instance: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: The requested DB Instance will be a member of a DB Cluster. Set backup retention period for the DB Cluster.
在取消注释备份保留期(它是在初始群集创建CLI调用以及播放中定义的)时,我会看到以下内容-
"msg": "Unable to create DB instance: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: VPC Multi-AZ DB Instances are not available for engine: aurora-mysql"
"msg": "Unable to create DB instance: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: The requested DB Instance will be a member of a DB Cluster. Set backup retention period for the DB Cluster.
是否可以使用Ansible创建Aurora Mysql多AZ RDS群集?通过阅读文档,它似乎还不受支持
是否可以使用Ansible管理集群内的DB实例,例如多az aurora mysql部署中的读写器节点?如果是,我该怎么做?我所有的测试都返回了与上面类似的结果
谢谢。我不确定Ansible是否支持极光,但所有这些错误消息都是有效的 您需要将
engine
更改为aurora-mysql
,并删除multi-az
或将其设置为false
,因为multi-az
不是可用的aurora功能
Multi-az在另一个可用性区域中创建RDS服务器的第二个“备份”实例。由于Aurora是一个集群而不是一个单实例系统,您只需要自己创建第二个实例,而不是指定
multi-az
是否有任何理由选择Ansible而不是Terraform?我的团队负责人讨厌Terraform,不愿意使用它(他对此感觉强烈)。谢谢。在我们的其他RDS集群中,我们启用了Multi-AZ。通过阅读AWS文档,在使用--availability zones
参数创建集群时是否设置了该选项?我想这是一种看待它的方式,是的。您需要配置多个可用性区域,因此从某种意义上说,所有Aurora集群都是多可用的。但是,要获得与RDS multi-az设置相同的即时故障切换行为,您需要确保Aurora群集中至少有2个实例。