amazon-web-services - Rds_instance 无法使用 Ansible 在 Aurora 集群中创建 RDS 数据库
问题描述
我正在尝试创建一个具有 1 个写入器/读取器节点的 Aurora 数据库集群。
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 多可用区 RDS 集群?通过阅读文档,它似乎还不受支持。
是否可以使用 Ansible 管理集群内的数据库实例,例如多 az aurora-mysql 部署中的读取器/写入器节点?如果是这样,我该怎么做?我所有的测试都返回了与上述类似的结果。
谢谢。
解决方案
我不确定 Ansible 是否支持 Aurora,但所有这些错误消息都是有效的。
您需要更改engine
为aurora-mysql
,并将其删除multi-az
或设置为,false
因为multi-az
它不是可用的 Aurora 功能。
Multi-az 在另一个可用区中创建 RDS 服务器的第二个“备份”实例。由于 Aurora 是一个集群而不是单实例系统,因此您只需自己创建第二个实例,而不是指定multi-az
.
推荐阅读
- flutter - 由于 navigator.pop 阻止底部工作表关闭
- python - 将下拉过滤器添加到 Plotly Express 图表
- spring-boot - 在成功或失败输出的情况下,REST API 中客户端的自定义响应
- blazor - 具有多个命名参数的 Blazor HTTPRequestMessage
- python - 如何在 plotly 中绘制 3D 表面上的边缘线?
- c++ - 为什么在类成员函数 C++ 中使用关键字“const”两次
- r - 如何有效地在(稀疏)矩阵中插入行?
- ruby-on-rails - RAILS 6.1 支持 ACTIVE STORAGE 中的多个 has_one_attached?
- kubernetes - 使用 kOps 更新 kubernetes 会导致 calico-node 失败并显示“BIRD 未准备好:BGP 未建立”
- java - PDF 小册子 - 可用。需要来自小册子示例的 PDF