Create a TiDB data source

更新时间:
复制 MD 格式

You must create a data source before you can create a data migration or data synchronization task. This topic describes how to create a TiDB data source in Data Transmission Service.

Security risks

When you use OceanBase Data Transmission Service, you can add its public CIDR blocks automatically or manually. This action can create security risks. Using this product, you acknowledge and accept these risks. You must implement basic security protections, such as using complex passwords, restricting open ports for each CIDR block, and using authentication for internal API communication. You should also regularly check and restrict access from unnecessary IP address ranges.

OceanBase Data Transmission Service automatically adjusts whitelists and security groups by adding or deleting entries based on business requirements and security risks. Do not use the IP address segments in these whitelists or security groups for business requirements that are not related to OceanBase Data Transmission Service. If you use these IP address segments for other business requirements, any issues that result are not covered by the OceanBase Data Transmission Service SLA. For more information about the whitelists and security groups that OceanBase Data Transmission Service adds automatically or manually, see the Add Whitelist module documentation.

Prerequisites

  • You have obtained the IP address and port number of the database.

  • You have a database user for data migration.

    We recommend that you create a dedicated database user for the data migration task. This user must have the required data operation permissions. For more information, see Create a TiDB database user.

  • To subscribe to TiDB incremental logs, you must have a Kafka data source and a Kafka topic. You must also create a task in advance to migrate data from the TiDB database to Kafka. For more information, see the official TiDB documentation.

    Important

    The database and table names that you configure for subscription in the TiDB database must match the names in the data migration task of Data Transmission Service.

Procedure

  1. Log on to the OceanBase Management Console .

  2. In the navigation pane on the left, click Data Transmission Service > Data Source Management.

  3. On the Data Source List page, click New Data Source in the upper-right corner.

    image.png

  4. In the New Data Source dialog box, set Data Source Type to TiDB.

    image

  5. Configure the parameters. Selecting a different Instance Type from the Instance Type drop-down list automatically displays the corresponding form below.

    image

    Instance Type

    Parameter

    Description

    Self-managed database in a VPC

    Cross-account for Alibaba Cloud

    Data Transmission Service lets you migrate or synchronize data between instances under different Alibaba Cloud accounts.

    You can choose whether to select this checkbox as needed. If you select the checkbox, enter the ID of the other Alibaba Cloud account. If you do not have permissions for that account, you must request authorization first. For more information, see Request cross-account authorization.

    VPC

    The unique ID of the public cloud VPC that you requested. Select the target VPC from the VPC drop-down list. You can also use fuzzy search.

    Common parameters

    A self-managed database instance with a public IP address includes all common parameters.

    Data Source Name

    Use a combination of letters and digits. The name cannot contain spaces and must be 32 characters or less.

    Host IP

    The IP address of the TiDB node.

    Port

    The port number of the TiDB node.

    Username

    The username of the TiDB database user for data migration or data synchronization.

    We recommend that you create a separate database user for data migration or data synchronization tasks. For more information, see Create a database user.

    Password

    The password of the database user.

    Incremental synchronization settings

    • Kafka Data Source/Topic

      The Kafka data source stores information from binary logs and incremental logs of TiDB data. The TiCDC tool transforms this data so that Data Transmission Service can consume it.

      • If you select this option, select the Kafka Data Source and its Topic that you want to attach from the drop-down list.

        Note

        Data Transmission Service currently supports only Kafka data sources that are self-managed Kafka instances in a VPC.

      • If you do not select this option, you cannot select Incremental Synchronization as the migration type when creating a data migration task from a TiDB database to an OceanBase database MySQL tenant.

    • TiDB Data Format

      When you migrate data from a TiDB database to a MySQL tenant of an OceanBase database, you can select data in TiCDC or TiDB Binlog format from the drop-down list.

    Remarks (Optional)

    The remarks for the data source.

  6. Click Test Connection to verify the network connectivity and the credentials for the data source.

  7. After the connection test passes, click OK.