The Database Gateway service provided by Alibaba Cloud allows you to connect a user-built database in an on-premises data center or a database in a third-party cloud to Alibaba Cloud services without requiring a public endpoint. This helps avoid the security risks posed by using public endpoints. Data Management Service (DMS) allows you to connect to a database in a third-party cloud by using a database gateway and then register and manage the database as an instance in the DMS console.
Enterprises and individual users who use a hybrid cloud may face the following challenges in database management:
- It generates high costs to use an Express Connect circuit to connect a database in a third-party cloud to a Virtual Private Cloud (VPC) of Alibaba Cloud. This method is not suitable for small enterprises and individual users.
- Exposing the public endpoint of a database may incur network attacks. This method cannot be used when the database is in the production environment.
- Enterprises and individual users need to manage request forwarding by themselves, which has high technical requirements and features low applicability, and thus the service stability cannot be guaranteed.
To address these problems, DMS allows you to register a database in a third-party cloud as an instance by using a database gateway, without requiring the public endpoint of the database. This method helps safeguard data security. For more information about Database Gateway, see Overview.
- The Database Gateway service is activated and a database gateway is created. For more information about how to create a database gateway, see Create a database gateway.
When you create a database gateway, download the gateway program to the server on which the target database is to be connected through the third-party internal network.
The target database is added to the created gateway. For more information, see Add databases.
DMS is activated.
You are a database administrator (DBA) or a DMS administrator.
Log on to the DMS console.
Move the pointer over the plus sign (+) in the upper-left corner and select Add instance.
You can also open the Add instance dialog box in the following way:
- In the top navigation bar, choose System Management > Instance.
- On the Instance List tab of the Instance page, click New in the upper-left corner.
In the Add instance dialog box that appears, click the No Access To Public tab.
In the No Access To Public section, select a database type.
In the dialog box that appears, set the parameters as required. The following table describes the parameters.
Tab Parameter Description Basic Information Database Source The category of the data source. Set this parameter to No Access To Public. Database type The type of the database to be registered. Instance Area The region where the database gateway resides. Gateway ID The ID of the database gateway that is used to connect to the database. If you do not have a database gateway, click Click here to add a database gateway to create one. Login Address The internal endpoint that is used to connect to the database. Port The port that is used to connect to the database. Database account The username that you use to log on to the database. Database password The password that you use to log on to the database. Control Mode The control mode that is used to manage the instance in DMS. For more information, see Control modes. Advanced Information Environment type The type of environment where the database is deployed. Instance Name The name that you specify for the instance in DMS. Enable DSQL Specifies whether to enable the cross-database query feature for the database. For more information, see Cross-database query. OnlineDDL Specifies whether to allow changing schemas without locking tables for the database and the specific method. For more information, see Change schemas without locking tables. DBA The DBA of the instance who is allowed to grant permissions to users. query timeout(s) The timeout interval of the statement that is used to query data. When the specified time interval is reached, the target statement run in the SQL editor is stopped to protect the database security. export timeout(s) The timeout interval of the statement that is used to export statistics. When the specified time interval is reached, the target statement run in the SQL editor is stopped to protect the database security.
On the Basic Information tab, click Test connection in the lower-left corner. Wait until the connectivity test is passed.
If the test fails, check the parameter values that you specify.
Click Submit.Now you have registered a database in a third-party cloud as an instance in DMS and the instance appears in the left-side navigation pane of the DMS console. You can view and manage the instance in the DMS console.