All Products
Search
Document Center

Dataphin:Create a GaussDB(DWS) data source

Last Updated:May 28, 2025

By creating a GaussDB(DWS) data source, you can enable Dataphin to read business data from GaussDB(DWS) or write data to GaussDB(DWS). This topic describes how to create a GaussDB(DWS) data source.

Permissions

Only custom global roles with the Create Data Source permission and system roles such as super administrator, data source administrator, domain architect, and project administrator can create data sources.

Procedure

  1. On the Dataphin homepage, choose Management Center > Datasource Management from the top navigation bar.

  2. On the Datasource page, click +Create Data Source.

  3. In the Relational Database section of the Create Data Source page, select GaussDB(DWS).

    If you have recently used GaussDB(DWS), you can also select GaussDB(DWS) in the Recently Used section. You can also quickly search for GaussDB(DWS) by entering keywords in the search box.

  4. On the Create GaussDB(DWS) Data Source page, configure the parameters for connecting to the data source.

    1. Configure the basic information of the data source.

      Parameter

      Description

      Datasource Name

      The name must meet the following requirements:

      • It can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).

      • It cannot exceed 64 characters in length.

      Datasource Code

      After you configure the data source code, you can directly access Dataphin data source tables in the format of data_source_code.table or data_source_code.schema.table when creating Flink SQL tasks or using the Dataphin JDBC client for quick consumption. If you need to automatically switch data sources based on the task execution environment, access them in the format of ${ds_code}.table or ${ds_code}.table.schema.table. For more information, see Dataphin data source table development method.

      Important
      • The data source code cannot be modified after it is configured successfully.

      • After the data source code is configured successfully, you can preview data on the object details page in the asset directory and asset inventory.

      • In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, and SelectDB data sources are currently supported.

      Data Source Description

      The description of the GaussDB(DWS) data source, which cannot exceed 128 characters.

      Data Source Configuration

      Based on whether the business data source distinguishes between production and development data sources:

      • If the business data source distinguishes between production and development data sources, select Production + Development Data Source.

      • If the business data source does not distinguish between production and development data sources, select Production Data Source.

      Tag

      You can categorize and tag data sources based on tags. For information about how to create tags, see Manage data source tags.

    2. Configure the connection parameters between the data source and Dataphin.

      If you select Production + Development Data Source for Data Source Configuration, you need to configure the connection information for both Production + Development Data Source. If you select Production Data Source for Data Source Configuration, you only need to configure the connection information for the Production Data Source.

      Note

      Typically, production and development data sources should be configured as different data sources to achieve environment isolation between development and production data sources, reducing the impact of development data sources on production data sources. However, Dataphin also supports configuring them as the same data source with identical parameter values.

      For Configuration Method, you can choose either JDBC URL or Host. The default selection is JDBC URL.

      JDBC URL configuration method

      Parameter

      Description

      JDBC URL

      The format of the connection URL is jdbc:opengauss://host:port/dbname. For example: jdbc:opengauss://192.168.**.1:5432/dataphin.

      Schema

      Enter the schema associated with the username.

      Username, Password

      The username and password used to log on to the database.

      Host configuration method
      • Host configuration method

        Parameter

        Description

        Server Address

        Enter the IP address and port number of the server.

        You can click +Add to add multiple sets of IP addresses and port numbers, and click the image icon to delete excess IP addresses and port numbers, but you must keep at least one set.

        dbname

        Enter the database name.

      • Parameter configuration

        Parameter

        Description

        Parameter

        • Parameter name: You can select an existing parameter name or enter a custom parameter name.

          Custom parameter names can only contain letters, digits, periods (.), underscores (_), and hyphens (-).

        • Parameter value: When a parameter name is selected, the parameter value is required. It can only contain letters, digits, periods (.), underscores (_), and hyphens (-), and cannot exceed 256 characters in length.

        Note

        You can add multiple parameters by clicking +Add Parameter, and delete excess parameters by clicking the image icon. You can add up to 30 parameters.

        Schema

        Enter the schema associated with the username.

        Username, Password

        The username and password used to log on to the GauseDB database.

      Note

      When the configuration method is set to Host and the data source creation is complete, if you need to switch to the JDBC URL configuration method, the system will concatenate the server's IP address and port number into a JDBC URL for filling.

    3. Configure advanced settings for the connection between the data source and Dataphin.

      Parameter

      Description

      connectTimeout

      The connectTimeout duration of the database (in seconds), default is 900 seconds (15 minutes).

      Note
      • If you have a connectTimeout configuration in the JDBC URL, the connectTimeout will be the timeout period configured in the JDBC URL.

      • For data sources created before Dataphin V3.11, the default connectTimeout is -1, which means no timeout limit.

      socketTimeout

      The socketTimeout duration of the database (in seconds), default is 1800 seconds (30 minutes).

      Note
      • If you have a socketTimeout configuration in the JDBC URL, the socketTimeout will be the timeout period configured in the JDBC URL.

      • For data sources created before Dataphin V3.11, the default socketTimeout is -1, which means no timeout limit.

      Connection Retry Count

      If the database connection times out, the system will automatically retry the connection until the specified number of retries is reached. If the maximum number of retries is reached and the connection is still unsuccessful, the connection fails.

      Note
      • The default retry count is 1, and you can configure a value between 0 and 10.

      • The connection retry count will be applied by default to offline integration tasks and global quality (requires the asset quality function module to be enabled). In offline integration tasks, you can configure task-level retry counts separately.

    Note

    Rules for duplicate parameter values:

    • If a parameter exists simultaneously in JDBC URL, Advanced Settings parameters, and Host Configuration method's parameter configuration, the value in the JDBC URL takes precedence.

    • If a parameter exists simultaneously in JDBC URL and Advanced Settings parameters, the value in the JDBC URL takes precedence.

    • If a parameter exists simultaneously in Advanced Settings parameters and Host Configuration method's parameter configuration, the value in the Advanced Settings parameters takes precedence.

  5. Select a Default Resource Group, which is used to run tasks related to the current data source, including database SQL, offline database migration, data preview, and more.

  6. Perform a Test Connection or directly click OK to save and complete the creation of the GaussDB(DWS) data source.

    Click Test Connection, and the system will test whether the data source can connect normally to Dataphin. If you directly click OK, the system will automatically test the connection for all selected clusters, but even if all selected clusters fail to connect, the data source can still be created normally.