【发布时间】:2022-02-09 04:42:11
【问题描述】:
我正在尝试创建生产数据库的只读副本,然后我想将该只读副本提升为测试数据库。
我已使用此 awscli 命令创建只读副本
aws rds create-db-instance-read-replica --db-instance-identifier test-database --source-db-instance-identifier production-database --region eu-central-1
我知道我不能立即发出提升只读副本命令,因为我会收到错误消息。
bash-3.2$ aws rds promote-read-replica --db-instance-identifier test-database --region eu-central-1
An error occurred (InvalidDBInstanceState) when calling the PromoteReadReplica operation: DB Instance is not in an available state.
如何检查只读副本是否创建成功,以便发出提升只读副本命令?
我试图查询数据库的事件,但它返回空。
bash-3.2$ aws rds describe-events --source-identifier test-database --source-type db-instance
{
"Events": []
}
我正在尝试在 Jenkins 管道中执行此操作,因此必须以编程方式对其进行检查。
请多多指教。
【问题讨论】:
标签: amazon-web-services amazon-rds aws-cli