Skip to main content

Create a PolarDB for PostgreSQL Data Source

NineData supports adding various types and environments of data sources to the console for unified management. You can use database DevOps, backup and recovery, data replication, and database comparison features for data sources that have been added. This article introduces how to add an Alibaba Cloud PolarDB for PostgreSQL data source to NineData.

Prerequisites

  • The server IP address of NineData has been added to the data source allowlist. Please refer to the image below for instructions on how to obtain the server IP address.

    server_ip_address

  • Make sure you have available data source quota; otherwise, the data source cannot be added. You can quickly check your remaining quota at the top-right corner of the NineData console.check_quota

Operation Steps

  1. Log in to the NineData console.

  2. In the left navigation bar, click Datasource**Datasource**.

  3. Click the Datasource tab and click Create Datasource on the page. In the pop-up data source type window, select Alibaba Cloud > PolarDB PostgreSQL. On the Create Datasource page, configure the parameters according to the table below.

    tip

    If you make a mistake in the operation, you can click the arrow_down icon at the top of the Create Datasource page to reselect.

  4. Configure the parameters for the data source:

    Parameter
    Description
    NameEnter the name of the data source. To facilitate subsequent search and management, please use meaningful names.
    ConnectionSelect the access method for the data source. Supports access through Direct connection address, SSH Tunnel.
    • IP Address: Access the data source through the public network address.
    • SSH Tunnel: Access the data source through an SSH tunnel.
    Connection selection of Direct connection addressHost: The public network connection address and port of the data source.
    Connection selection of SSH Tunnel
    • SSH Host: Enter the public IP or domain name of the server where the target data source is located, and the corresponding port number (the default port number for SSH service is 22).
    • SSH Authentication Method: Select the SSH authentication method.
      • Password: Connect through SSH Username (i.e., the server login name) and Password (i.e., the server login password).
        • SSH Username: Enter the login username of the server where the target data source is located.
        • Password: Enter the login password of the server where the target data source is located.
      • Key (recommended): Connect through SSH Username and Key File.
        • SSH Username: Enter the login username of the server where the target data source is located.
        • Key File: Click Upload to upload the private key file, which is a key file without a suffix.
        • Password: Enter the password set when generating the key file. If you did not set a password during the key generation process, leave this field blank.
    • Note: After the SSH configuration is completed, you need to click the Connection Test on the right, and there may be two possible results:
      • Prompt Connection Successfully: Indicates that the SSH Tunnel has been established.
      • Prompt error message: Indicates a connection failure. You need to troubleshoot based on the error message and retry.
    • Host: Can be written as localhost (data source on the local machine) or the intranet IP of the host where the data source is located.
    DB AccountEnter the database login username.
    DB PasswordEnter the database login password.
    client character setDefine the character encoding used by the application to generate and parse text data (such as GBK, UTF8), NineData will perform bidirectional transcoding between the application and the database based on this encoding to avoid garbled text during reading and writing.
    client timezoneDefine the time zone information of the application, NineData will convert the stored data to the defined time zone when reading date and time fields without time zone information and return it. For example, if your application is located in Shanghai, fill in +08:00.
    Access RegionSelect the region closest to the location of your database host to effectively reduce network latency.
    EnvironmentChoose according to the actual business purpose of the data source, as an environmental identifier for the data source. Default provides PROD and DEV environments, and supports you to create custom environments.
    EncryptionWhether to use SSL encryption to access the data source (default off). If the data source enforces SSL encrypted connections, this switch must be turned on, otherwise, the connection will fail.
    Click the switch on the right to turn on or off encrypted transmission. Click the > to the left of Encryption to expand detailed configuration.
    SSL Options: Supports the following four methods.
    • Prefer: Automatically detect the SSL status of the server, if the server has SSL enabled, connect through SSL first, if the server does not have SSL enabled, connect through non-SSL.
    • Require: Always connect to the data source through SSL, if the server does not support this method or cannot establish an SSL connection for other reasons, the connection will fail.
    • Verify-CA: Upload the CA certificate to verify whether the server's service certificate is issued by a trusted institution to prevent man-in-the-middle attacks. At the same time, according to the needs, upload the client user certificate and key to verify your identity and encrypt the communication with the server.
    • Verify-full: On the basis of Verify-CA, check whether the subject of the server certificate (such as hostname, IP address) matches the actual server connected to ensure the security of the connection.
  5. After all configurations are completed, click Connection Test on the right side of Create Datasource to test whether the data source can be accessed normally. If prompted with Connection Successfully, you can click Create Datasource to complete the addition of the data source. Otherwise, please recheck the connection settings until the connection test is successful.