无法使用 AWS CLI 创建极光集群的只读副本

Unable to create read replica to aurora cluster using AWS CLI

我正在尝试使用以下命令创建只读副本:

aws rds create-db-instance-read-replica --db-instance-identifier dbname-read --source-db-instance-identifier dbname --availability-zone us-east-1c

我收到以下错误:

A client error (InvalidDBInstanceState) occurred when calling the CreateDBInstanceReadReplica operation: Automated backups are not enabled for this database instance. To enable automated backups, use ModifyDBInstance to set the backup retention period to a non-zero value.

我检查过集群配置了自动备份:

{
"DBInstances": [
    {
        "PubliclyAccessible": false, 
        "MasterUsername": "root", 
        "LicenseModel": "general-public-license", 
        "VpcSecurityGroups": [
            {
                "Status": "active", 
                "VpcSecurityGroupId": "sg"
            }
        ], 
        "InstanceCreateTime": "2015-12-20T02:38:26.179Z", 
        "CopyTagsToSnapshot": false, 
        "OptionGroupMemberships": [
            {
                "Status": "in-sync", 
                "OptionGroupName": "default:aurora-5-6"
            }
        ], 
        "PendingModifiedValues": {}, 
        "Engine": "aurora", 
        "MultiAZ": false, 
        "DBSecurityGroups": [], 
        "DBParameterGroups": [
            {
                "DBParameterGroupName": "default.aurora5.6", 
                "ParameterApplyStatus": "in-sync"
            }
        ], 
        "AutoMinorVersionUpgrade": true, 
        "PreferredBackupWindow": "03:44-04:14", 
        "DBSubnetGroup": {
            "Subnets": [
                {
                    "SubnetStatus": "Active", 
                    "SubnetIdentifier": "subnet", 
                    "SubnetAvailabilityZone": {
                        "Name": "us-east-1a"
                    }
                }, 
                {
                    "SubnetStatus": "Active", 
                    "SubnetIdentifier": "subnet", 
                    "SubnetAvailabilityZone": {
                        "Name": "us-east-1c"
                    }
                }
            ], 
            "DBSubnetGroupName": "dev-subnet-group", 
            "VpcId": "vpc", 
            "DBSubnetGroupDescription": "dev-subnet-group", 
            "SubnetGroupStatus": "Complete"
        }, 
        "ReadReplicaDBInstanceIdentifiers": [], 
        "AllocatedStorage": 1, 
        *"BackupRetentionPeriod": 7,*
        "PreferredMaintenanceWindow": "mon:10:11-mon:10:41", 
        "Endpoint": {
            "Port": 3306, 
            "Address": "dbname.us-east-1.rds.amazonaws.com"
        }, 
        "DBInstanceStatus": "available", 
        "EngineVersion": "5.6.10a", 
        "AvailabilityZone": "us-east-1a", 
        "DBClusterIdentifier": "dbname", 
        "StorageType": "aurora", 
        "DbiResourceId": "db-**********", 
        "CACertificateIdentifier": "rds-ca-2015", 
        "StorageEncrypted": false, 
        "DBInstanceClass": "db.r3.large", 
        "DbInstancePort": 0, 
        "DBInstanceIdentifier": "dbname"
    }
]

}

有什么想法吗?

谢谢, 罗伊

极光引擎不支持

create-db-instance-read-replica

而是使用

创建另一个实例
create-db-instance

选项 --db-cluster-identifier

所以新创建的实例会自动同步 writer/master 会自动提升为只读。