In this blog post, we will demonstrate the way to archive network type change for ApsaraDB RDS instances.
In fact, there are two ways to transform from classic network to a VPC network. Let's get started with a quick comparison for different methods.
Approaches | Description | Steps | Endpoint Changes | Scenarios | Summary |
Method 1 | Switch to VPC Directly (Replace original classic network endpoint) |
1. Change to VPC 2. Test Network Connections |
Remain No Change | Suitable for simple applications with only one server and one database instance. | Easy to operate but may have greater risks for network connection issues due to incomplete understanding of the business architecture. |
Method 2 (Better) |
Switch to VPC in Stages (Reserve original classic network endpoint) |
1. Enable Hybrid Access 2. Change Configurations of Business Applications & Verify Network Connections 3. Delete Classic Network Endpoints |
With New Endpoint | Suitable for complex applications with a lot of upstream and downstream services. | It may cost more time but it provides a more secure way to archive the goal. |
As you can see, taking business risks into consideration, the method 2 is a safe and better choice which we would recommend.
Next, let's see how to phrase out your classic network step by step.
Env Comparison | Before | After |
Database Endpoints (Internal Endpoints) |
rm-3ns152te2f2tfn3wk01.mysql.rds.aliyuncs.com | rm-3ns152te2f2tfn3wk01.mysql.rds.aliyuncs.com |
Endpoint Changes | - | Remain No Change |
Business Impacts | - | • The instance will perform a HA failover which lasts for 30s. • All database connections break during the time and these connections can be recovered only if the client retry to connect the database. |
Tips:
• To avoid network connection issues, please ensure all resources in your production environment switched to a VPC network accordingly. Especially be sure to use the same VPC and vSwitch for resources that relate to the same application so that they can communicate with each other.
• Make sure you added the client IP lists into the database instance whitelist so that the access requests won't be refused.
Detailed Operations:
Step 1: Switch to VPC
Click Switch to VPC in database connection function, then configure VPC and vSwitch, and before submit, please remember do NOT check the optional checkbox of "Retain Original Classic Network Endpoint".
This operation can usually be completed within 30 seconds. If the instance is a High Availability Series instance, the backend will perform an HA failover after submitting it in the prompt window. During this time, all database connections are interrupted and can only be restored when the database client retries to connect to the database. If you are not sure if the retry mechanism is available at the application layer, you can restart the application to trigger a reconnection.
Step 2: Test Network Connectivity
When the instance turns back to be running, you can try to connect database instance from the database client in same VPC or directly observe the status of your application so that to ensure network connectivity.
If the database client can not connect to your database instance, please check on the followings:
• if the database instance uses the same VPC as database client?
• if the whitelist of the VPC is configured properly?
Env Comparison | Before | After |
Database Endpoints (Internal Endpoints) |
rm-3ns02y5l3obf3iepj01.mysql.rds.aliyuncs.com | rm-3ns152te2f2tfn3wk01.mysql.rds.aliyuncs.com & rm-3ns02y5l3obf3iepj917.mysql.rds.aliyuncs.com |
Endpoint Changes | - | A new database endpoint is added into the instance. |
Business Impacts | - | • No business interruptions during the operation. • As you need to change the business configurations one by one due to the change of database endpoints. It may require reboot of your application everytime you perform this change. |
Tips:
• Make sure you added the client IP lists into the database instance whitelist so that the access requests won't be refused.
Detailed Operations:
Step 1: Switch to VPC
Click Switch to VPC in database connection function, then configure VPC and vSwitch, and before submit, please CHECK the optional checkbox of Retain Original Classic Network Endpoint.
Please note that choosing to retain original classic network endpoints means it allows you to temporarily keep both classic network endpoint access and VPC endpoint access at the same time, which is known as hybrid access.
Step 2: Change Configurations of Business Applications & Verify Network Connections
If you have many servers in application layer which works closely with the certain database instances that you just operated in step 1, then you should add new database endpoint into the configuration files of the application. Then test connectivity via the new VPC-based endpoint.
If there are many servers connected to the database instance, this can be very tedious as it needs to be repeated over and over again.
Similarly, if the database client can not connect to your database instance, please check on the followings:
• if the database instance uses the same VPC as database client?
• if the whitelist of the VPC is configured properly?
Step 3: Delete Classic Network Endpoints
Since the hybrid access is only a temporary solution, you also need to delete existing classic network endpoints at the end.
Therefore, please remember that the classic network endpoint need to be deleted after all servers in the application layer have changed their database endpoints to the new one and have passed the network connection check.
Besides, if you have DTS related to the ApsaraDB RDS, you just need to perform the following extra actions to ensure everything works well:
• Add DTS Server IP lists into the ApsaraDB RDS whitelist accordingly;
• Pause DTS then restart it.
For more information, you can leave comments, contact our support team or read documentations on our website.
Graph Database with PolarDB: Practice of Graph Analysis in the Banking and Financial Sector
Alibaba Clouder - February 21, 2020
JustinCook - January 10, 2022
Alibaba Clouder - February 26, 2019
Alibaba Clouder - August 24, 2020
Alibaba Clouder - October 25, 2018
Alibaba Cloud Community - March 21, 2022
Supports data migration and data synchronization between data engines, such as relational database, NoSQL and OLAP
Learn MoreTair is a Redis-compatible in-memory database service that provides a variety of data structures and enterprise-level capabilities.
Learn MoreAlibaba Cloud offers an accelerated global networking solution that makes distance learning just the same as in-class teaching.
Learn MoreConnect your business globally with our stable network anytime anywhere.
Learn MoreMore Posts by ApsaraDB