Accessing SelectDB Data Source through the Gateway
NineData supports accessing SelectDB data sources through a gateway, allowing you to connect to SelectDB without providing an external address, even if it's in a private or dedicated network environment.
Prerequisites
- The host where the gateway is deployed must be within the SelectDB data source's intranet environment and must be able to access the SelectDB data source smoothly through the intranet.
- The host where the gateway is deployed must have internet access. If your host cannot access the internet and is within a local area network, you can deploy a proxy gateway. For more information, see Using a Proxy Gateway.
Step 1: Deploy the Gateway
This step is applicable to hosts that can access the public network. If your host cannot access the public network and is in the local area network, see Using Proxy Gateway to deploy the gateway.
Log in to the NineData console on the host where the gateway needs to be deployed.
In the left navigation pane, click >.
Click in the upper right corner of the page.
Configure the parameters based on the following table.
Parameter Description The name of the gateway. For easy searching and management, manual specification is supported. Select the operating system of the host where the gateway needs to be deployed, and the corresponding gateway installation method is displayed. The following operating systems are supported: - Windows(x86_64)
- Linux(x86_64)
- macOS
Select the region closest to the host where the gateway is deployed to obtain relatively fast access speed. No configuration required. Install and configure the gateway on the host of the deployment end based on the installation method displayed below. After the configuration is completed, the connection diagram on the right side of the page changes from to .
Click on , select the desired data source in the pop-up window, and proceed to Step 2.
Step 2: Access the SelectDB Data Source
On the page, configure the parameters based on the table below.
Parameter Description Enter the name of the data source. For ease of later retrieval and management, please use a meaningful name. Select . Select the gateway ID deployed in Step 1. Enter the access address and port of the SelectDB data source. - If SelectDB is installed on the local machine: Enter
localhost
or127.0.0.1
for the address and the actual port of SelectDB for the port. - If SelectDB is installed on another host within the intranet: Enter the intranet IP of that host for the address and the actual port of SelectDB for the port.
Enter the login username for SelectDB. Enter the login password for SelectDB. Select the region closest to your SelectDB host to effectively reduce network latency. Select according to the actual business purpose of the data source as an environment identifier for the data source. The default provides the and environments, and also supports you to create a custom environment.
Note: In organization mode, the database environment can also be applied to permission policy management. For example, the default role only supports access to data sources in the environment and cannot access data sources in other environments. For more information, see Managing Roles.Specify whether to use SSL encryption to access the data source (default is on). If the data source requires SSL encryption, you must enable this switch; otherwise, the connection will fail.
Click the switch on the right to enable or disable encryption transmission. Click the left of to expand detailed configurations.- : Supports two options:
- : Automatically detects the SSL status of the server. If SSL is enabled on the server, it will connect via SSL. If SSL is not enabled on the server, it will connect without SSL.
- : Always connects via SSL. If the server does not support this method or cannot establish an SSL connection for other reasons, the connection will fail.
- : Specify the SSL-Cipher encryption algorithm.
- : If the SelectDB server uses a self-signed CA-issued certificate, you need to upload the root certificate of that CA here.
- : Check to verify the server's name and IP address to ensure that you are connecting to the real SelectDB server and avoid Man-in-the-Middle Attacks.
- : If the SelectDB server requires the client to provide a certificate, you need to upload the client's certificate and key here. The SelectDB server will verify the information you uploaded to ensure the connection's security.
- If SelectDB is installed on the local machine: Enter
After configuring all parameters, click on the right of to test whether the data source can be accessed normally. If is displayed, click to complete adding the data source. If not, please recheck the connection settings until the connection test succeeds.
Appendix: Using a Proxy Gateway
If the host where the gateway needs to be deployed cannot access the public network, a proxy gateway is needed. You need to prepare two hosts in the same LAN that can access each other:
- Host A: A host that can access the public network.
- Host B: The host where the gateway needs to be deployed.
Create a gateway in Host A. The role of this gateway is to act as a proxy so that Host B can connect to the NineData server through the proxy.
Procedure
Log in to the NineData console on Host A.
In the left navigation bar, click > .
Click in the upper right corner of the page.
Configure the parameters according to the following table.
Parameter Description The name of the gateway, which can be manually specified for easy search and management. Select the operating system of the host where the gateway needs to be deployed, and the corresponding gateway installation method will be displayed. The following operating systems are supported: - Windows (x86_64)
- Linux (x86_64)
- macOS
Select the region closest to the host where the gateway is deployed to obtain relatively fast access speed. No need to configure. Install and configure the gateway in Host A according to the installation method displayed below. After the configuration is completed, the connection diagram on the right side of the page will change from to .
Click , and then click in the upper right corner of the page again.
In , select the operating system of Host B.
Click , select , and click the drop-down box below . Select the gateway created in Host A from the drop-down menu.
tipAt this point, the gateway process will automatically open a port on Host A for Host B's access. When the page prompts "xxx has enabled proxy function, port xxx", it means that the proxy gateway has been successfully opened.
Install the gateway on Host B according to the installation steps displayed below.
Wait for the connection diagram on the right side of the page to change from to .
Click to enter Step 2.