简体   繁体   English

我们可以使用云形成模板将RDS只读副本提升为主吗?

[英]Can we promote RDS read replica to primary using cloud formation template?

我们可以使用控制台和 CLI 轻松提升 RDS 只读副本,但是有没有办法让主访问意味着使用云形成提升主访问?

CloudFormation uses the property "SourceDBInstanceIdentifier" to determine whether a DBInstance is a read replica or not. CloudFormation 使用“SourceDBInstanceIdentifier”属性来确定 DBInstance 是否为只读副本。 If this property has any non-empty value, the DBInstance will be created as a read replica.如果此属性具有任何非空值,则 DBInstance 将创建为只读副本。

If you remove this property once a read replica is created and update your CloudFormation stack, a new DBInstance will be created that won't be a read replica, it will be it's own standalone database.如果您在创建只读副本后删除此属性并更新您的 CloudFormation 堆栈,则会创建一个新的 DBInstance,它不是只读副本,而是它自己的独立数据库。 However, the new standalone database will not have the contents of the read replica.但是,新的独立数据库将没有只读副本的内容。

The solution to this will be to regularly back up your read replica.对此的解决方案是定期备份您的只读副本。 When you want to promote your read replica, remove "SourceDBInstanceIdentifier" and set "DBSnapshotIdentifier" to the most recent snapshot of the read replica.如果要提升只读副本,请删除“SourceDBInstanceIdentifier”并将“DBSnapshotIdentifier”设置为只读副本的最新快照。 This should effectively promote your read replica to master with most the data still intact这应该有效地将您的只读副本提升为 master,并且大部分数据仍然完好无损

The RDS standby replica (multi-az) will automatically be switched to master in case of failures on the master node. RDS备用副本(multi-az)会在master节点出现故障时自动切换到master。

How you setup the multi-az replica (could be through cloudformation) will determine the automatic switch over.您如何设置多可用区副本(可以通过 cloudformation)将决定自动切换。 Please note that the standby replica becomes the master only when there is an AZ outage, primary instance fail, software patching and not when there is scenarios of locks or database level operation timeouts.请注意,备用副本仅在出现可用区中断、主实例故障、软件补丁时才成为主副本,而不会出现锁定或数据库级操作超时的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我们如何使用 AWS 云形成模板创建跨区域 RDS 只读副本? - How can we create cross region RDS read replica using AWS cloud formation template? 当我们提升读取副本以分离RDS实例时会发生什么? - What all happens when we promote a read replica to separate RDS instance? 我们可以将AWS RDS只读副本视为备份吗? - Can we consider AWS RDS read replica as Backup? 我们可以从现有 VPC 中导出 Cloud Formation 模板吗? - Can we export Cloud Formation template from an existing VPC? 我们可以在单个云形成模板中创建的资源总数是多少? - what is the total no of resources can we create in single cloud formation template? 当使用自动缩放创建ec2时,我们可以在云形成模板中为EC2添加CNAME吗? - Can we add a CNAME for an EC2 in Cloud Formation Template when ec2s are created using auto scaling? 我们可以将 RDS MYSQL/POSTGRES 只读副本视为 AWS DMS 的源端点吗? - can we consider RDS MYSQL/POSTGRES read replica's as source endpoint for AWS DMS? RDS-使用只读副本时的最大副本滞后 - RDS - max replica lag when using read replica Cloud Formation - 无法上传模板文件 - Cloud Formation - can't upload template file 我们应该如何使用 Cloud Formation 模板更新 S3 存储桶上的默认加密? - How should we Update default encryption on S3 buckets using Cloud Formation Template?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM