This topic describes how to migrate ApsaraDB for Cassandra data by using the BDS service.

Background information

BDS is a NoSQL data migration service provided by Alibaba Cloud. BDS allows you to migrate ApsaraDB for Cassandra data online. You can use BDS to migrate a large amount of ApsaraDB for Cassandra data in a short time. BDS reduces the service interruption time to minutes and minimizes the impact on your business.

Prerequisites

  • A destination environment for data migration is prepared. For example, an ApsaraDB for Cassandra database is purchased.
  • The SSH File Transfer Protocol (SFTP) service is enabled for the source ApsaraDB for Cassandra cluster. For information about how to enable the SFTP service, see Enable the SFTP service.
  • If you need incremental migration, you must first enable the incremental backup feature by running the nodetool command in the source ApsaraDB for Cassandra cluster.

Procedure

  1. Log on to the Alibaba Cloud official website and purchase the BDS service.
    Note
    • When you create the BDS service, we recommend that you keep the region and the zone for BDS consistent with those for the source ApsaraDB for Cassandra cluster.
    • When you create the BDS service, we recommend that you use the same VPC and vSwitch for BDS as those for the source ApsaraDB for Cassandra cluster.
    Purchase BDS
  2. Configure the endpoints of the source and destination clusters.
    1. Add the IP addresses of the source and destination ApsaraDB for Cassandra clusters to the whitelist of the BDS service.
      Note Configure the whitelist by choosing Access Control > Add Whitelist.
    2. Add the IP address of the BDS service to the whitelist of the destination ApsaraDB for Cassandra cluster.
  3. Add data sources of the source and destination clusters.
    1. Log on to the cluster management page: On the details page in the BDS console, choose Basic Information > UI Access > BDS, and enter the account password.
      Note If you forget your password, click Reset UI Access Password on the details page of BDS to reset the password.
      Log on to BDS
    2. Choose Data Source Manage > Add Data Source to go to the Add data source page.
      Add data resource
    3. Specify names for the source and destination clusters. Set the data source type to Cassandra3x and configure the data source parameters.
      You can refer to the following template of the data source parameters:
      {
        "cassandraPassword": "The password for accessing the ApsaraDB for Cassandra cluster",
        "cassandraUser": "The account for accessing the ApsaraDB for Cassandra cluster",
        "confDir": "The directory of your ApsaraDB for Cassandra profile",
        "dataDir":[
          "The directory of your ApsaraDB for Cassandra data"
        ],
        "hosts":[
          {
            "ip": "The IP address of the ApsaraDB for Cassandra cluster. If the cluster has multiple IP addresses, organize them in the following manner"
          },
          {
            "ip": "The second IP address of the cluster. The rest may be deduced by analogy"
          },
          {
            "ip": "The third IP address of the cluster"
          }
        ],
        "nodetoolCmd": "The directory of the nodetool command of your ApsaraDB for Cassandra cluster. Specify the directory to the nodetool level, such as xxx/bin/nodetool".
        "sshPassword": "The password used for access over SSH",
        "sshUser": "The account used for access over SSH",
        // The following two lines in the data source template must be configured for the destination cluster. You must enter the absolute paths in the commands that start and stop the ApsaraDB for Cassandra cluster. Delete this prompt from the actual data source profile.
        "startCmd": "su cassandra -l -c 'The command that starts the ApsaraDB for Cassandra cluster'", 
        "stopCmd": "su cassandra -l -c 'The command that stops the ApsaraDB for Cassandra cluster'"
      }
    4. Click Add.
  4. Create and start a migration task.
    1. Choose Cassandra Migration > Cassandra Migration to go to the start page of the ApsaraDB for Cassandra migration task.
    2. Enter the source and destination data sources, and select an operation task, including initialize target cluster, migrate table schema, real time data replication, and history data migration.
      Note
      • The source data source and the destination data source refer to the names of the source data source cluster and the destination data source cluster that you specified on the data source management page.
      • When you migrate full data for the first time, we recommend that you select all the four operation tasks.
    3. Optional:Add the table information to be synchronized: In the table mapping section, enter the information about the table to be migrated in the required format.
      Note If you do not enter the table information, the full table is migrated by default.
    4. Click Create to start the migration.
    Start migration