通過控制檯很容易,但我需要從CLI執行相同的操作。AWS Aurora:如何通過aws cli恢復數據庫集羣快照?
首先,我創建了一個數據庫快照:
aws rds create-db-cluster-snapshot \
--db-cluster-snapshot-identifier $SNAPSHOT_ID \
--db-cluster-identifier $CLUSTER \
羣只有一個作家實例
,因爲它throwned錯誤
客戶端的錯誤,我沒有使用
create-db-snapshot
方法(InvalidParameterValue )在調用CreateDBSnapshot操作時發生:指定的實例是羣集的成員,並且不能直接創建快照。請改用CreateDBClusterSnapshot API。
它的工作原理:
aws rds create-db-cluster-snapshot \
--db-cluster-snapshot-identifier $SNAPSHOT_ID \
--db-cluster-identifier $CLUSTER \
{
"DBClusterSnapshot": {
"Engine": "aurora",
"SnapshotCreateTime": "2016-12-08T11:48:07.534Z",
....
}
所以,我想從快照還原一個新極光集羣,然後我想:
aws rds restore-db-instance-from-db-snapshot \
--db-instance-identifier from-snap2 \
--db-snapshot-identifier snap2 \
A client error (DBSnapshotNotFound) occurred when calling the RestoreDBInstanceFromDBSnapshot operation: DBSnapshot not found: snap2
所以,我試圖與恢復:
aws rds restore-db-cluster-from-snapshot \
--db-cluster-identifier from-snap2 \
--snapshot-identifier snap2 \
--engine aurora \
--vpc-security-group-ids $PREPROD_SG \
--db-subnet-group-name my-db-subnet-group \
它的工作原理...
{
"DBCluster": {
...
"EngineVersion": "5.6.10a",
"DBClusterIdentifier": "from-snap2",
...
"DBClusterMembers": [],
...
}
但爲什麼集羣不包含任何Aurora實例?
錯誤在哪裏?