This article demonstrates how to downgrade an RDS MySQL instance from multi-availability-zone (Multi-AZ) to a single instance (single zone). The process is simple and worked well in my test. If I was to do this in a production environment, I would a) dump the database first just in-case the process failed, and b) make sure there was sufficient time allocated to the outage (change management) to import the database into a new instance if all goes bad.
While creating the test environment in AWS, I used the following settings:
- MySQL 5.6.40
- DB T2 Micro
- Selected: Create replica in different zone
- Selected: Provisioned IOPS (SSD)
- Selected: 100GB
I was able to log in and see the databases hosted in the RDS service:
$ mysql -h testrds.lksjdfkdsjf.ap-southeast-2.rds.amazonaws.com -u admin -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 16 Server version: 5.6.40 Source distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | innodb | | mysql | | performance_schema | | sys | | testdb | +--------------------+ 6 rows in set (0.00 sec) MySQL [(none)]>
While logged into the AWS web portal, I had to wait 10 minutes for the “Modify” button to become active for the test RDS instance. Once active, I changed the setting “Multi-AZ deployment” from “Yes” to “No”.
The overview page still showed the database as being Multi-AZ for a few minutes. Eventually it changed to “No” indicating the change had taken place. I opted to have the changes take effect immediately but it still took a few minutes.
While I did this little test, I remained logged into the MySQL CLI to see if I’d be kicked out during the change. I wasn’t.
Warning, I did this test with no data loaded into MySQL so I don’t know if there would be an outage if there was significant data in the database. I suspect not but can’t say for sure.