Create an OBS data source

Updated at:

Create an OBS data source to enable Dataphin to read service data from or write data to Huawei Cloud Object Storage Service (OBS).

Background

To use Huawei Cloud OBS with Dataphin, you must first create an OBS data source. This allows you to use it for data development or to write data from Dataphin to OBS.

The primary use case for an OBS data source is unstructured file storage. After you create the data source, you can select it in the file input component and file output component of a data collection task to read and write unstructured files.

Permissions

To create data sources, you must have a custom global role with the Create Data Source permission or be assigned a system role such as super administrator, data source administrator, project architect, or project administrator.

Procedure

  1. On the Dataphin homepage, click Management Center > Data Source Management in the top navigation bar.

  2. On the Data Source Management page, click + New Data Source.

  3. On the New Data Source page, select OBS in the File section.

    If you have recently used OBS, you can also select it from the Recently Used section. Alternatively, you can enter OBS in the search box to find it.

  4. On the New OBS Data Source page, configure the connection parameters.

    1. Configure the basic information for the data source.

      Parameter

      Description

      Data Source Name

      Enter a name for the data source. The name must meet the following requirements:

      • Can contain only Chinese characters, uppercase or lowercase letters, digits, underscores (_), and hyphens (-).

      • Cannot exceed 64 characters in length.

      Data Source Code

      After you configure the code, you can reference tables in a Flink_SQL task by using the Data Source Code.Table Name or Data Source Code.schema.Table Name format. To automatically access the data source that corresponds to the current environment, use the variable format ${Data Source Code}.table or ${Data Source Code}.schema.table. For more information, see Develop Flink SQL tasks.

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

      • You can preview data on the object details page in the asset directory and asset checklist only after the data source code is configured.

      • In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, SelectDB, and GaussDB data warehouse service (DWS) data sources are currently supported.

      Data Source Description

      Enter a brief description of the data source, up to 128 characters in length.

      Data Source Configurations

      Select the type of data source to configure:

      • If your service data source has separate production and development instances, select Production + Dev Data Source.

      • If your service data source does not have separate instances for production and development, select Production Data Source.

      Tags

      You can add a tag to classify the data source. To learn how to create a tag, see Manage Data Source Tags.

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

      If you selected Production + Dev Data Source, configure connections for both environments. If you selected Production Data Source, configure the production connection only.

      Note

      Typically, you should configure the production and development data sources as different sources to ensure environment isolation and prevent development activities from impacting the production environment. However, Dataphin also allows you to use the same source for both by providing identical parameter values.

      Parameter

      Description

      Endpoint

      The endpoint for the region where your OBS bucket is located. The format is https://obs.{Region}.myhuaweicloud.com, where {Region} is the bucket's region ID. For example, for the cn-north-4 region, enter https://obs.cn-north-4.myhuaweicloud.com.

      OBS endpoints are region-specific. You must use a different domain name to access each region. For more information, see Endpoints and Access Domain Names.

      Bucket

      The name of the bucket in the corresponding OBS region. A bucket is a container for storing objects in Huawei Cloud OBS. You can log in to the Huawei Cloud OBS console and find the name in the bucket list.

      You can create one or more buckets, each of which can contain multiple files. In a data collection task, you can only access files in the bucket specified here.

      Directory

      If you have permissions only for a specific directory, specify the directory path. For example, /dataphin/.

      Access ID, Access Key

      The access key (AK/SK) of the Huawei Cloud account that owns the OBS data source.

      For information about how to obtain an access key, see Access Key (AK/SK).

      Note

      This refers to the access key ID and secret of a non-Alibaba Cloud account.

  5. Select the Default Resource Group. This resource group runs tasks related to the data source, such as data collection tasks and dataset tasks.

  6. Click Test Connection, or click OK to save the configuration and create the OBS data source.

    Clicking Test Connection verifies the connection between the data source and Dataphin. If you click OK directly, the system automatically tests the connection. You can create the data source even if the connection test fails.