All Products
Search
Document Center

DataV:How to use DataV Proxy

Last Updated:Jan 19, 2024

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

  1. The DataV Proxy application obtains the encrypted SQL query strings and database IDs.

  2. The application connects to the database to query data.

  3. The application returns the results to the DataV console.

Start the DataV Proxy application

  • Windows:

    1. Download the DataV Proxy application installation package.

    2. Decompress the package and double-click the datav_proxy_wins.exe file.

    3. Sign up and log on to the DataV Proxy application.

    4. On the DataV Proxy page, add a data source and query logs. For more information, see Configure DataV Proxy.

  • Linux or macOS:

    1. 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                        
    2. Decompress the package to the directory of the project.

    3. Run the following command to start DataV Proxy on port 8001 by default:

      chmod 777 ./*
      sh exec.sh start
      Note
      • You 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.

    4. 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.

    5. Sign up and log on to the DataV Proxy application.

    6. 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

  1. 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.

    Note

    You need to sign up and log on to the DataV Proxy application for the first access.

  2. 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.

    Important

    Before 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.

    1. Click Data Source Settings, select a data source type, and then click Add. 配置数据源

    2. 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.

    3. 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.

      数据源测试

  3. Queries logs.

    Queries project logs. You can specify a range of log rows to query rows that contain keywords. 查询日志

    Important

    In Windows, you can only view the logs but cannot query them based on keywords or the specified range of log rows.

  4. 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. 生成密钥

    Important

    The key is empty by default.xxx

Use the DataV Proxy application

  1. Log on to the DataV console.

  2. Choose My Data> > Add Data. > Data Source Management > Add Data.

  3. 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.

  4. 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.

    Important

    According 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.

  5. 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.