Updated on 2024-11-29 GMT+08:00

Creating a Database Link

Scenario

Create a database link on the CDLService web UI.

Prerequisites

  • You have obtained the driver JAR package of the data to be connected.
  • A user with CDL management operation permissions has been created by referring to Creating a CDL User for the cluster with Kerberos authentication enabled.

Procedure

  1. Log in to the CDLService web UI as a user with CDL management operation permissions or as user admin (for clusters with Kerberos authentication disabled) by referring to Logging In to the CDLService Web UI.
  2. Choose Link Management and click Add Link. In the displayed dialog box, enter the link name (cannot be the same as an existing one) and select the link type.
  3. Set other link parameters based on the link type.

    Table 1 MySQL data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    mysql

    Name

    Link name

    mysqllink

    DB driver

    Select the uploaded MySQL driver JAR file mysql-connector-java-8.0.24.jar.

    mysql-connector-java-8.0.24.jar

    CAUTION:

    The value must be mysql-connector-java-8.0.24.jar. Otherwise, the database connection may fail to be created.

    Host

    IP address of the MySQL database

    10.10.10.10

    Port

    MySQL database port

    3306

    User

    User for accessing the MySQL database

    user

    Password

    Password for accessing the MySQL database

    Password of the user user

    Description

    Data link description.

    xxx

    Table 2 PgSQL data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    pgsql

    Name

    Link name

    pgsqllink

    Host

    IP address of the PgSQL database

    10.10.10.10

    Port

    PgSQL database port

    5432

    DB Name

    PgSQL database name

    testDB

    User

    User for accessing the PgSQL database

    user

    Password

    Password for accessing the PgSQL database

    Password of the user user

    Description

    Data link description

    xxx

    Table 3 Oracle data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    oracle

    Name

    Link name

    oraclelink

    DB driver

    Select the uploaded Oracle driver file ojdbc8-12.2.0.1.jar.

    ojdbc-12.1.0.1.0.jar

    Host

    IP address of the Oracle database

    10.10.10.10

    Port

    Oracle database port

    1521

    User

    User for accessing the Oracle database

    user

    Password

    Password for accessing the Oracle database

    Password of the user user

    Sid

    Service ID of Oracle

    orcl

    Description

    Data link description.

    xxx

    Table 4 Kafka data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type.

    kafka

    Name

    Link name.

    kafkalink

    Description

    Data link description.

    -

    Table 5 Hudi data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type.

    hudi

    Name

    Link name.

    hudilink

    Storage Type

    Storage type, which can be either of the following:

    hdfs: Data is stored in HDFS.

    hdfs

    Auth KeytabFile

    Keytab file of a user. You can click Upload File to upload the keytab file.

    Set this parameter only for a cluster in security mode.

    NOTE:

    To obtain this file, log in to FusionInsight Manager and choose System. On the navigation pane on the left, choose Permission > User and choose More > Download User Credential in the Operation column.

    ${BIGDATA_HOME}/third_lib/CDL/user_libs/1699627721775user.keytab

    Principal

    Domain name of the user who accesses HDFS.

    Set this parameter only for a cluster in security mode.

    cdltest

    Description

    Data link description.

    xxx

    Table 6 thirdparty-kafka data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    thirdparty-kafka

    Name

    Link name

    thirdparty-kafkalink

    Bootstrap Servers

    Kafka proxy instance, which can be set to a value in the format of Service IP address of the Kafka Broker instance:Kafka port number.

    NOTE:

    If MRS Kafka is used as the source of thirdparty-kafka, log in to FusionInsight Manager, choose Cluster > Services > Kafka, click Configurations, search for the port in the search box, and obtain the port number based on the encryption protocol.

    10.10.10.10:21007

    Security Protocol

    Encryption protocol. Value options are as follows:

    • SASL_PLAINTEXT
    • PLAINTEXT
    • SASL_SSL
    • SSL

    SASL_PLAINTEXT

    Username

    Username specified when SASL_SSL is enabled during instance creation

    NOTE:

    This parameter is available only when Security Protocol is set to SASL_PLAINTEXT or SASL_SSL.

    test

    Password

    Password configured when SASL_SSL is enabled during instance creation

    NOTE:

    This parameter is available only when Security Protocol is set to SASL_PLAINTEXT or SASL_SSL.

    xxx

    SSL Truststore Location

    Path where the client.truststore.jks authentication file is stored

    NOTE:

    This parameter is available only when Security Protocol is set to SASL_SSL or SSL.

    -

    SSL Truststore Password

    Password of the client.truststore.jks certificate file

    NOTE:

    This parameter is available only when Security Protocol is set to SASL_SSL or SSL.

    xxx

    Datastore Type

    Type of the upper-layer source. Value options are as follows:

    • drs-opengauss-json
    • ogg-oracle-avro
    • drs-oracle-json
    • drs-oracle-avro
    • debezium-json

    drs-opengauss-json

    DB driver

    Uploaded thirdparty-kafka driver file

    NOTE:

    This parameter is available only when Datastore Type is set to ogg-oracle-avro.

    -

    Host

    IP address of the thirdparty-kafka database

    NOTE:

    This parameter is unavailable when Datastore Type is set to drs-oracle-json.

    11.11.xxx.xxx,12.12.xxx.xxx

    Port

    thirdparty-kafka database port

    NOTE:

    This parameter is unavailable when Datastore Type is set to drs-oracle-json.

    8000

    DB Name

    thirdparty-kafka database name

    NOTE:

    This parameter is available only when Datastore Type is set to drs-opengauss-json.

    opengaussdb

    User

    thirdparty-kafka database access user

    NOTE:

    This parameter is unavailable when Datastore Type is set to drs-oracle-json.

    opengaussuser

    DB Password

    Password for accessing the thirdparty-kafka database

    NOTE:

    This parameter is unavailable when Datastore Type is set to drs-oracle-json.

    Password of the opengaussuser user

    Sid

    Service ID of Oracle

    NOTE:

    This parameter is available only when Datastore Type is set to ogg-oracle-avro.

    -

    Description

    Data link description.

    -

    Table 7 GaussDB(DWS) data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    dws

    Name

    Link name

    dwslink

    Host

    IP address of the GaussDB(DWS) database to be connected

    10.10.10.10

    Port

    Database port

    8000

    DB Name

    Name of the database to be connected to

    default

    User

    Database access user

    test

    Password

    Password for accessing the database

    xxx

    Description

    Data link description.

    -

    Table 8 opengauss data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    opengauss

    Name

    Link name

    opengausslink

    Host

    IP address of the opengauss database to be connected

    10.10.10.10

    Port

    Database port

    8000

    DB Name

    Name of the database to be connected to

    default

    User

    Database access user

    test

    Password

    Password for accessing the database

    xxx

    Description

    Data link description.

    -

    Table 9 ClickHouse data link parameters

    Parameter

    Description

    Example Value

    Link Type

    Link type

    clickhouse

    Name

    Link name

    clickhouselink

    Host

    Service IP address of the ClickHouseBalancer instance of ClickHouse:HTTP balancer port number. Multiple ClickHouse instances can be connected using commas (,).

    NOTE:

    To obtain the HTTP balancer port number, log in to Manager, choose Cluster > Services > ClickHouse, click Logic Cluster, and obtain the port number from the HTTP Balancer Port column in the cluster list.

    10.10.10.10:21428

    User

    Database access user

    test

    Password

    Password for accessing the database

    xxx

    Description

    Data link description.

    -

  4. After the parameters are configured, click Test to check whether the data link is normal.

    After the test is successful, click OK.