本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
重新啟動 Amazon DocumentDB 執行個體
有時,您可能需要重新啟動 Amazon DocumentDB 執行個體,通常是出於維護原因。如果您進行某些變更,例如變更與叢集相關聯的叢集參數群組,則必須重新啟動叢集中的執行個體讓變更生效。您可以使用 AWS Management Console 或 重新啟動指定的執行個體 AWS CLI。
重新啟動執行個體,將重新啟動資料庫引擎服務。重新啟動會導致暫時中斷,在此期間,執行個體狀態會設定為 rebooting
。重新啟動完成時,會建立 Amazon DocumentDB 事件。
重新啟動執行個體不會導致容錯移轉。若要容錯移轉 Amazon DocumentDB 叢集,請使用 AWS Management Console 或 AWS CLI 操作 failover-db-cluster
。如需詳細資訊,請參閱Amazon DocumentDB 容錯移轉。
如果執行個體不是可用狀態,就無法重新啟動執行個體。資料庫無法使用可能由多種原因導致,例如,先前要求的修改,或維護時段的動作。如需執行個體狀態的詳細資訊,請參閱監控 Amazon DocumentDB 執行個體的狀態。
- Using the AWS Management Console
-
以下程序會重新啟動您使用主控台指定的執行個體。
-
登入 AWS Management Console,並在 https://console.aws.amazon.com/docdb
:// 開啟 Amazon DocumentDB 主控台。 -
在導覽窗格中,選擇叢集。
提示
如果畫面左側沒有出現導覽窗格,請選擇頁面左上角的功能表圖示 (
)。
-
在叢集導覽方塊中,您會看到 欄叢集識別符。您的執行個體會列在叢集下,類似於下方的螢幕擷取畫面。
-
勾選您要重新啟動之執行個體左側的方塊。
-
選擇Actions (動作)、選擇 Reboot (重新啟動),然後選擇 Reboot (重新啟動) 以確認重新啟動。
執行個體重新啟動需要幾分鐘的時間來完成。您只能使用狀態為可用的執行個體。您可以使用主控台或 AWS CLI監控執行個體的狀態。如需詳細資訊,請參閱監控 Amazon DocumentDB 執行個體的狀態。
-
- Using the AWS CLI
-
若要重新啟動 Amazon DocumentDB 執行個體,請使用
reboot-db-instance
操作搭配--db-instance-identifier
參數。此參數會指定要重新啟動之執行個體的識別符。以下程式碼會重新啟動執行個體
sample-instance
。若為 Linux、macOS 或 Unix:
aws docdb reboot-db-instance \ --db-instance-identifier sample-instance
針對 Windows:
aws docdb reboot-db-instance ^ --db-instance-identifier sample-instance
此操作的輸出將會如下所示。
{ "DBInstance": { "DBInstanceIdentifier": "sample-instance", "DBInstanceClass": "db.r5.large", "Engine": "docdb", "DBInstanceStatus": "rebooting", "Endpoint": { "Address": "sample-instance.node.us-east-1.docdb.amazonaws.com", "Port": 27017, "HostedZoneId": "ABCDEFGHIJKLM" }, "InstanceCreateTime": "2020-03-27T08:05:56.314Z", "PreferredBackupWindow": "02:00-02:30", "BackupRetentionPeriod": 1, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-abcd0123", "Status": "active" } ], "AvailabilityZone": "us-east-1c", "DBSubnetGroup": { "DBSubnetGroupName": "default", "DBSubnetGroupDescription": "default", "VpcId": "vpc-abcd0123", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-abcd0123", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-wxyz0123", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "sun:06:53-sun:07:23", "PendingModifiedValues": {}, "EngineVersion": "3.6.0", "AutoMinorVersionUpgrade": true, "PubliclyAccessible": false, "DBClusterIdentifier": "sample-cluster", "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:<accountID>:key/sample-key", "DbiResourceId": "db-ABCDEFGHIJKLMNOPQRSTUVWXYZ", "CACertificateIdentifier": "rds-ca-2019", "PromotionTier": 1, "DBInstanceArn": "arn:aws:rds:us-east-1:<accountID>:db:sample-instance", "EnabledCloudwatchLogsExports": [ "profiler" ] } }
執行個體重新啟動需要幾分鐘的時間來完成。您只能使用狀態為可用的執行個體。您可以使用主控台或 AWS CLI監控執行個體的狀態。如需詳細資訊,請參閱監控 Amazon DocumentDB 執行個體的狀態。