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

时间:2015-12-23 08:25:46

标签: amazon-web-services rds aws-cli

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

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

我收到以下错误:

  

调用CreateDBInstanceReadReplica操作时发生客户端错误(InvalidDBInstanceState):未对此数据库实例启用自动备份。要启用自动备份,请使用ModifyDBInstance将备份保留期设置为非零值。

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

{
"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"
    }
]

}

有什么想法吗?

谢谢, Roey

1 个答案:

答案 0 :(得分:3)

Aurora引擎不支持

create-db-instance-read-replica

而只是使用

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

选项--db-cluster-identifier

因此新创建的实例将自动与writer / master同步,将被提升为自动读取。