Rebooting an Amazon DocumentDB Instance

Occasionally, you might need to reboot your Amazon DocumentDB instance, usually for maintenance reasons. If you make certain changes, such as changing the cluster parameter group that is associated with a cluster, you must reboot the instances in the cluster for the changes to take effect. You can reboot a specified instance using the AWS Management Console or the AWS CLI.

Rebooting an instance restarts the database engine service. Rebooting results in a momentary outage, during which the instance status is set to rebooting. An Amazon DocumentDB event is created when the reboot is completed.

Rebooting an instance doesn’t result in a failover. To failover an Amazon DocumentDB cluster, use the AWS Management Console or the AWS CLI operation failover-db-cluster. For more information, see Amazon DocumentDB Failover.

You can’t reboot your instance if it isn’t in the available state. Your database can be unavailable for several reasons, such as a previously requested modification, or a maintenance-window action. For more information on instance states, see Monitoring an Amazon DocumentDB Instance’s Status.

Rebooting an Instance Using the AWS Management Console

The following procedure reboots an instance that you specify using the console.

  1. Sign in to the AWS Management Console, and open the Amazon DocumentDB console at https://console.aws.amazon.com/docdb.

  2. In the navigation pane, choose Clusters .

    Tip

    If you don’t see the navigation pane on the left side of your screen, choose the menu icon (Rebooting an Instance - 图1) in the upper-left corner of the page.

  3. In the Clusters navigation box, you’ll see the column Cluster Identifier. Your instances are listed under clusters, similar to the screenshot below.

    Rebooting an Instance - 图2

  4. Check the box to the left of the instance you wish to reboot.

  5. Choose Actions, choose Reboot, and then choose Reboot to confirm your reboot.

It takes a few minutes for your instance to reboot. You can use the instance only when its status is available. You can monitor the instance’s status using the console or the AWS CLI. For more information, see Monitoring an Amazon DocumentDB Instance’s Status.

Rebooting an Instance Using the AWS CLI

To reboot an Amazon DocumentDB instance, use the reboot-db-instance operation with the --db-instance-identifier parameter. This parameter specifies the identifier for the instance to be rebooted.

The following code reboots the instance sample-instance.

For Linux, macOS, or Unix:

  1. aws docdb reboot-db-instance \
  2. --db-instance-identifier sample-instance

For Windows:

  1. aws docdb reboot-db-instance ^
  2. --db-instance-identifier sample-instance

Output from this operation looks something like the following.

  1. {
  2. "DBInstance": {
  3. "DBInstanceIdentifier": "sample-instance",
  4. "DBInstanceClass": "db.r5.large",
  5. "Engine": "docdb",
  6. "DBInstanceStatus": "rebooting",
  7. "Endpoint": {
  8. "Address": "sample-instance.node.us-east-1.docdb.amazonaws.com",
  9. "Port": 27017,
  10. "HostedZoneId": "ABCDEFGHIJKLM"
  11. },
  12. "InstanceCreateTime": "2020-03-27T08:05:56.314Z",
  13. "PreferredBackupWindow": "02:00-02:30",
  14. "BackupRetentionPeriod": 1,
  15. "VpcSecurityGroups": [
  16. {
  17. "VpcSecurityGroupId": "sg-abcd0123",
  18. "Status": "active"
  19. }
  20. ],
  21. "AvailabilityZone": "us-east-1c",
  22. "DBSubnetGroup": {
  23. "DBSubnetGroupName": "default",
  24. "DBSubnetGroupDescription": "default",
  25. "VpcId": "vpc-abcd0123",
  26. "SubnetGroupStatus": "Complete",
  27. "Subnets": [
  28. {
  29. "SubnetIdentifier": "subnet-abcd0123",
  30. "SubnetAvailabilityZone": {
  31. "Name": "us-east-1a"
  32. },
  33. "SubnetStatus": "Active"
  34. },
  35. {
  36. "SubnetIdentifier": "subnet-wxyz0123",
  37. "SubnetAvailabilityZone": {
  38. "Name": "us-east-1b"
  39. },
  40. "SubnetStatus": "Active"
  41. }
  42. ]
  43. },
  44. "PreferredMaintenanceWindow": "sun:06:53-sun:07:23",
  45. "PendingModifiedValues": {},
  46. "EngineVersion": "3.6.0",
  47. "AutoMinorVersionUpgrade": true,
  48. "PubliclyAccessible": false,
  49. "DBClusterIdentifier": "sample-cluster",
  50. "StorageEncrypted": true,
  51. "KmsKeyId": "arn:aws:kms:us-east-1:<accountID>:key/sample-key",
  52. "DbiResourceId": "db-ABCDEFGHIJKLMNOPQRSTUVWXYZ",
  53. "CACertificateIdentifier": "rds-ca-2019",
  54. "PromotionTier": 1,
  55. "DBInstanceArn": "arn:aws:rds:us-east-1:<accountID>:db:sample-instance",
  56. "EnabledCloudwatchLogsExports": [
  57. "profiler"
  58. ]
  59. }
  60. }

It takes a few minutes for your instance to reboot. You can use the instance only when its status is available. You can monitor the instance’s status using the console or AWS CLI. For more information, see Monitoring an Amazon DocumentDB Instance’s Status.