How can I minimize downtime during required Amazon RDS maintenance?iam.awslagi
Concept: I received a maintenance notification that says one of my Amazon Relational Database Service (Amazon RDS) DB instances requires maintenance. How can I minimize downtime during required Amazon RDS maintenance?
Understanding Amazon RDS pending maintenance events and resolutions
AWS RDS has 3 types of pending maintenance events.
DB engine maintenance
Upgrades to the database engine level require downtime. Even if your RDS DB instance uses a Multi-AZ deployment, both the primary and standby DB instances are upgraded at the same time. This causes downtime until the upgrade is complete, and the duration of the downtime varies based on the size of your DB instance. For more information, see the section for your DB engine in Upgrading a DB Instance Engine Version.
Before maintenance is scheduled, you receive an email notification about scheduled hardware maintenance windows that includes the time of the maintenance and the Availability Zones that are affected. During hardware maintenance, Single-AZ deployments are unavailable for a few minutes. Multi-AZ deployments are unavailable for the time it takes the instance to failover (usually about 60 seconds) if the Availability Zone is affected by the maintenance. If only the secondary Availability Zone is affected, then there is no failover or downtime.
After OS maintenance is scheduled for the next maintenance window, maintenance can be postponed by adjusting your preferred maintenance window. Maintenance can also be deferred by choosing Defer Upgrade from the Actions dropdown menu. To minimize downtime, modify the Amazon RDS DB instance to a Multi-AZ deployment. For Multi-AZ deployments, OS maintenance is applied to the secondary instance first, then the instance fails over, and then the primary instance is updated. The downtime is during failover. For more information, see Maintenance for Multi-AZ Deployments.
How can I checking AWS RDS Pending maintenance events?
1. Using AWS RDS Console. Check the Events pane of the Amazon RDS console. Then, check for engine-specific maintenance events.
2. Using AWS CLI. You can run describe-pending-maintenance-actions using the AWS Command Line Interface (AWS CLI) or the Amazon RDS API for DescribeDBInstances.
aws rds describe-pending-maintenance-actions
3. Using AWS Personal Dashboard
Adjusting the Preferred DB Instance Maintenance Window
The maintenance window should fall at the time of lowest usage and thus might need modification from time to time. Your DB instance will only be unavailable during this time if the system changes, such as a change in DB instance class, are being applied and require an outage, and only for the minimum amount of time required to make the necessary changes.
In the following example, you adjust the preferred maintenance window for a DB instance.
- Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
- In the navigation pane, choose Databases, and then select the DB instance that you want to modify.
- Choose Modify. The Modify DB Instance page appears.
- In the Maintenance section, update the maintenance window.
- Choose Continue.
- On the confirmation page, review your changes.
- To apply the changes to the maintenance window immediately, select Apply immediately.
- Choose Modify DB Instance to save your changes.
- Alternatively, choose Back to edit your changes, or choose Cancel to cancel your changes.
Using AWS CLI
To adjust the preferred maintenance window, use the AWS CLI modify-db-instance command with the following parameters:
For Linux, macOS, or Unix:
aws rds modify-db-instance \ --db-instance-identifier mydbinstance \ --preferred-maintenance-window Tue:04:00-Tue:04:30