Aurora MySQL Cluster-如何识别只读副本

时间:2019-01-29 19:21:51

标签: python boto3 amazon-rds-aurora

我们有一堆Aurora MySQL群集,需要使用boto3识别哪些实例是Master,哪些实例是只读副本。群集端点的副本名称中带有“ -ro-”。这是唯一的方法吗?   抱歉,如果已经回答。

1 个答案:

答案 0 :(得分:0)

最后找到它了。需要使用“ describe_db_cluster_endpoints”方法。

import boto3
client = boto3.client('rds', 'my-region')
my_cluster = client.describe_db_cluster_endpoints(DBClusterIdentifier='my-aurora-cluster')
print my_cluster

并查找“ EndpointType”,将出现“ WRITER”或“ READER”