DataV Proxy is a visualized DataV Proxy(DataV Proxy Service) configuration tool. You can use DataV Proxy to access databases that are not accessible to the public and do not have public endpoints. This topic describes how to use DataV Proxy.
How it works
The DataV Proxy application obtains the encrypted SQL query strings and database IDs.
The application connects to the database to query data.
The application returns the results to the DataV console.
Start the DataV Proxy application
Windows:
Download the DataV Proxy application installation package.
Decompress the package and double-click the
datav_proxy_wins.exe
file.Sign up and log on to the DataV Proxy application.
On the DataV Proxy page, add a data source and query logs. For more information, see Configure DataV Proxy.
Linux or macOS:
Run the following command to download the DataV Proxy software package:
wget https://sh-conf.oss-cn-shanghai.aliyuncs.com/doc_files/datav_proxy.zip
Decompress the package to the directory of the project.
Run the following command to start DataV Proxy on port
8001
by default:chmod 777 ./* sh exec.sh start
NoteYou can also run the
sh exec.sh start -p [Port number]
command to start DataV Proxy by using the specified port, for example,sh exec.sh start -p 8080
.You can run the
sh exec.sh stop
command to stop DataV-WS.
After the service is started, enter
http:// domain name /IP: port
in the browser.Domain Name /IP: Enter the public domain name or IP address of the server on which DataV Proxy is installed.
Set Port to the port number used to start DataV Proxy.
Sign up and log on to the DataV Proxy application.
On the DataV Proxy application page, perform operations such as adding data sources and querying logs. For more information, see Configure DataV Proxy applications.
Configure the DataV Proxy application
Enter
http://{IP address or domain name of the server}: port
(for example,http://10.10.10.10:8001
) to go to the DataV Proxy application configuration page.NoteYou need to sign up and log on to the DataV Proxy application for the first access.
Configure the data source.
Configure the basic information of the database. After the configuration is complete, you can perform the Link and SQL to ensure the reliability of the data source.
ImportantBefore you add a data source, add Take an ApsaraDB RDS for MySQL instance as an example. You must add the
IP address of the server
in the first step to the whitelist of the ApsaraDB RDS for MySQL instance. For more information, see Connect to an ApsaraDB RDS for MySQL instance by using a client or a CLI.Click Data Source Settings, select a data source type, and then click Add.
In the dialog box that appears, configure the data source.
Parameter
Description
id
The ID of the data source. The value is custom and cannot be duplicate.
host
The IP address or domain name of the server where the database resides. For example, if the data source is an ApsaraDB RDS for MySQL instance, set this parameter to the external endpoint of the instance. You can obtain the endpoint on the Basic Information page of the ApsaraDB for RDS console, for example, rm-bp1xxxxxxxxxxxxxhmo.mysql.rds.aliyuncs.com.
user
The username used to log on to the database.
password
The password that is used to connect to the database.
database
The name of the database that belongs to the account.
port
The port number of the database. For example, the port number used to connect to ApsaraDB RDS MySQL instances is 3306 by default.
Test the configured data source.
Click link to test the connectivity of the database.
Click SQL. In the dialog box that appears, enter an SQL statement to test data in the database.
Queries logs.
Queries project logs. You can specify a range of log rows to query rows that contain keywords.
ImportantIn Windows, you can only view the logs but cannot query them based on keywords or the specified range of log rows.
Generate a key.
This parameter is used to configure a DataV data source. Click Generate Key /Secret. A new key and secret are generated and the old key becomes invalid.
ImportantThe key is empty by default.xxx
Use the DataV Proxy application
Log on to the DataV console.
Choose . > Data Source Management > Add Data.
In the Add Data dialog box, configure the parameters.
Parameter
Description
Type
Select DataV Data Proxy Service.
Name
The name of the data source. It can be user-defined.
Domain Name
The IP address or domain name of the DataV Proxy server. You can obtain the value from the Configure the DataV Proxy application section.
Port Number
The port used to start DataV Proxy. You can obtain the value from the Configure the DataV Proxy application section. By default, the port is 8001.
Key
Enter the key generated in step 4 in the Configure the DataV Proxy application section.
Secret
Enter the secret generated in step 4 in the Configure the DataV Proxy application section.
Database
The ID of the data source that is added to the DataV Proxy application.
After the preceding information is specified, DataV automatically checks the connectivity of the data source.
Click Obtain Databases and select a database as the data source from the database list. If the ID of the data source added to the DataV Proxy application is displayed in the list, the connection is successful.
ImportantAccording to the security policy of the browser, no HTTP requests are allowed in HTTPS pages, and DataV Proxy is accessed through the browser, so it must be consistent with the request response protocol for opening the page. If you are using an IP address or do not have an HTTPS domain name, you need to use the DataV console to open DataV and access the DataV Proxy application. If you want to access DataV Proxy over HTTPS, you must have the HTTPS endpoint of DataV Proxy.
Click OK.
After you add a data source, you can add the data source to a widget for display. For more information, see Configure asset data.