Alibaba Cloud Database Gateway (DG) lets you connect on-premises or third-party cloud databases to Alibaba Cloud services without exposing a public IP address. This avoids the security risks of public IP connections. With Database Gateway, you can register these databases in Data Management (DMS) for centralized management.
Background
When connecting on-premises or third-party cloud databases to Alibaba Cloud, several solutions are available, but each has limitations:
-
Use a leased line, VPN gateway, or Smart Access Gateway (SAG) instance: This method is costly and not ideal for individual users.
-
Expose the database service port to the public internet: This creates security risks and makes your database vulnerable to attacks.
-
Build a custom proxy to forward service requests: This approach often lacks stability and incurs high technical and maintenance costs.
To address these challenges, Data Management (DMS) lets you use a Database Gateway to register on-premises or third-party cloud databases. This method establishes a secure, encrypted connection without exposing your database's public IP address. For more information about Database Gateway, see What is Database Gateway?.
Procedure
Log in to DMS 5.0.
-
In the top navigation bar, choose .
NoteIf you use the DMS console in simple mode, move the pointer over the
icon in the upper-left corner and choose . -
At the top of the page, select the region where your database is located (China (Hangzhou) is selected by default), and then click Create Gateway.
-
In the dialog box that appears, enter a Gateway Name and Note, and then click Next.
-
Install the gateway. Select an installation package based on your operating system. For Windows, click Download Installation Package. For other operating systems, copy the command and run it on the machine where you want to install the gateway. When the gateway starts successfully, you are automatically directed to the next step to add a database. Alternatively, click Next to proceed manually.
NoteDatabase Gateway is currently free of charge. Ensure that the host machine where the gateway program runs meets the following requirements:
-
It can connect to the target database. For lower network latency, deploy the gateway in the same internal network as the database.
-
It has access to the public internet. A public IP address is not required, and no ports need to be exposed. The host only needs to initiate outbound internet connections.
-
-
Add a database. Click Add Database Address to add a database now, or add it later. For more information about how to add a database, see Procedure.
In the Add Method section, select Manual Add. In the database address input field, enter the address in the
host:portformat, for example,172.168.200.152:3306. Press Enter to create a tag, and then click Finish. -
In the upper-left corner of the DMS console, click the
icon to add an instance. -
In the Add Instance dialog box, select Third-party Cloud/Self-managed and choose the specific database type.
-
In the Add Instance dialog box, configure the parameters as described in the following table.
Tab
Parameter
Description
Basic Information
Database type
Select the type of your database instance.
Instance region
Select the region where your Database Gateway is deployed.
Gateway ID
Select the Database Gateway. If you have not created a gateway, click Click here to add a database gateway.
Database address
Enter the internal network address of the target database.
Database account
Enter the username for the database account.
Database password
Enter the password for the database account.
Control mode
Select the control mode for the database. For more information, see Control Modes.
Sensitive Data Protection
If you need to govern and mask sensitive data, use Sensitive Data Protection to scan database metadata, identify sensitive data, and then mask and manage it.
Advanced Information
Environment type
Select the environment type for the database.
Instance name
Enter a custom instance name.
Lock-free Schema Change
Select whether to enable the Lock-free Schema Change feature. For more information, see Implement lock-free schema changes by using lock-free change tickets.
Enable SSL
If you enable this option, DMS uses an encrypted connection to access your database. The database server must support SSL connections.
Instance DBA
Select a DBA to handle processes such as permission requests.
Query timeout (s)
Terminates queries on the SQL console if their execution time exceeds the specified value. This protects your database.
Export timeout (s)
Terminates export tasks on the SQL console if their execution time exceeds the specified value. This protects your database.
-
Click Test Connectivity in the lower-left corner and wait for the test to succeed.
NoteIf the connection test fails, check the instance information that you entered.
-
Click Submit. The database is now registered in Data Management (DMS). You can view and manage your database from the instance list on the left side of the DMS console.