Help Center/ Distributed Database Middleware/ Getting Started/ Buying a DDM Instance and Connecting to a Schema Using a Linux System
Updated on 2024-08-05 GMT+08:00

Buying a DDM Instance and Connecting to a Schema Using a Linux System

This example illustrates how to purchase a DDM schema and connect to it from a Linux ECS over a private network.

Step 1: Buy a DDM Instance

  1. Go to the Buy DDM Instance page.
  2. On the displayed page, configure the required parameters and click Next.
  3. Perform subsequent operations based on the billing mode you select:

    • If you select Pay-per-use, click Submit.
    • If you select Yearly/Monthly, click Pay Now.

  4. View the purchased instance.

    Figure 1 Instance successfully purchased

Step 2: Buy an RDS for MySQL DB Instance

  1. Go to the Buy DB Instance page.
  2. Configure the instance information and click Next.

    • A DDM instance can be associated with RDS for MySQL instances of versions 5.7 and 8.0.
    • The RDS for MySQL instance must be in the same VPC and subnet as your DDM instance. If they are not in the same subnet, configure routes to ensure network connectivity.
    • Specifications of associated RDS for MySQL instances should be greater than that of the DDM instance. Otherwise the performance will be affected.
    Figure 2 Network configurations

  3. Confirm the configurations and click Submit. Wait 1 to 3 minutes for the RDS instance to be created.
  4. View the purchased RDS instance.

Step 3: Create a DDM Account and Associate It with an RDS for MySQL Instance

  1. Log in to the DDM console.
  2. In the instance list, locate the required DDM instance and click its name.
  3. In the navigation pane, choose Accounts.
  4. On the displayed page, click Create Account.
  5. In the dialog box that is displayed, configure the account information and click OK.

    The value of the password validity period must be an integer ranging from 0 to 65535, in days. If the value is 0, the password never expires. If this parameter is not set, the password will always be valid.

  6. On the Instances page, locate the required DDM instance and click Create Schema in the Operation column.
  7. On the Create Schema page, set required parameters and click Next.
  8. On the displayed page, enter a database account with the required permissions and click Test Availability.

    Figure 3 Testing availability of data nodes

  9. After the test is successful, click Finish.
  10. View the associated RDS for MySQL instance.

    Figure 4 DB instance successfully associated

Step 2: Buy an ECS

  1. Go to the Buy ECS page.
  2. Configure basic settings and click Next: Configure Network. Keep the region and AZ of the ECS the same as those of the DDM instance to be connected.

    An image is an ECS template that contains an OS and applications. In this example, a Linux public image is selected, which is provided by Huawei Cloud by default.

    Figure 5 Basic settings
    Figure 6 Selecting an image

  3. Configure the ECS network and click Next: Configure Advanced Settings.

    To download a MySQL client to the ECS, bind an EIP to the ECS. The ECS must be in the same VPC as the DDM instance for mutual communications.

    Figure 7 Network configuration
    Figure 8 Selecting an EIP

  4. Configure a password for the ECS and click Next: Confirm.

    Figure 9 Advanced settings

  5. Confirm the configurations and click Submit.

    Figure 10 Confirming the configurations

  6. View the purchased ECS.

Step 5: Connect to a DDM Schema

  1. Use a Linux remote connection tool (for example, MobaXterm) to log in to the ECS. Enter the EIP bound to the ECS for Remote host.

    Figure 11 Creating a session

  2. Enter the password set when buying the ECS.

    Figure 12 Entering the password
    Figure 13 Successful login

  3. Download the mysql-community-client-8.0.26-1.el6.x86_64.rpm client installation package by selecting the required product version and operating system.

    Figure 14 Selecting a version
    Figure 15 Downloading the client package

  4. Upload the client installation package to the ECS.

    Figure 16 Uploading the client package
    Figure 17 Package uploaded

  5. Install the client.

    rpm -ivh --nodeps mysql-community-client-8.0.26-1.el6.x86_64.rpm
    Figure 18 Installing a client

  6. Run the following command to connect to the DDM schema. IP is the private IP address of the DDM instance.

    mysql -h <IP> -u <userName> -P 5066 -p

    Example:

    mysql -h 192.*.*.* -u root -P 5066 -p
    Figure 19 Connection successful