我正在尝试创建一个具有1个写入器/读取器节点的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
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",如果我将引擎设置为aurora-mysql,我会看到以下内容-
"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"在取消对备份保留期(在初始群集创建CLI调用和实演中定义)的注释时,我看到以下内容-
"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 Multi-AZ RDS集群吗?从文档上看,它似乎还不受支持。
是否可以使用Ansible来管理集群中的DB实例,例如多az aurora-mysql部署中的读取器/写入器节点?如果是这样,我该怎么做呢?我的所有测试都返回了与上面类似的结果。
谢谢。
发布于 2021-02-09 03:40:22
我还不确定Ansible是否支持Aurora,但所有这些错误消息都是有效的。
您需要将engine更改为aurora-mysql,并删除multi-az或将其设置为false,因为multi-az不是一个可用的Aurora功能。
Multi-az在另一个可用区中创建RDS服务器的第二个“备份”实例。由于Aurora是一个集群而不是单个实例系统,因此您只需自己创建第二个实例,而不是指定multi-az。
https://stackoverflow.com/questions/66108046
复制相似问题