Connection error of ApsaraDB for OceanBase

Updated at: 2023-01-19 03:19

This topic describes general causes of the database connection error and solutions.

Error

ApsaraDB for OceanBase cannot be connected.

Causes

The database connection may fail due to one of the following causes:

  1. Incorrect public or private IP address.

  2. Local IP addresses or CIDR blocks for the test connection are not added to the whitelist.

  3. Incorrect account password.

  4. Incorrect tenant mode for the connection.

  5. The network type of the ECS client is not VPC.

  6. The ECS client and the ApsaraDB for OceanBase instance are not in the same region.

    The ECS client and the ApsaraDB for OceanBase tenant use different VPCs.

Solutions

Check public and private IP addresses

  1. Log on to the ApsaraDB for OceanBase console.

  2. On the Clusters page, select the cluster to be checked. Click the name of the target cluster to go to the Cluster Workspace page.

  3. In the left-side navigation pane, click Tenant Management to go to the Tenants page. Click the name of the target tenant to go to the Tenant Workspace page.

  4. In the Deployment Diagram section, view your private and public IP addresses.

    Note

    A private IP address is applied for a tenant during its creation by default. If a tenant needs to be connected over the public network, apply for a public IP address for it.

Check whitelist settings

  1. Log on to the ApsaraDB for OceanBase console.

  2. On the Clusters page, select the cluster to be checked. Click the name of the target cluster to go to the Cluster Workspace page.

  3. In the left-side navigation pane, click Security Settings.

  4. In the Whitelist Group section of the Security Settings page, check whether local IP addresses or CIDR blocks for the test connection have been added.

    Note

    • At present, the whitelist of ApsaraDB for OceanBase takes effect at the cluster level. Therefore, the whitelist cannot identify tenant types or distinguish private IP addresses from public ones.

    • When you specify public or private IP addresses in the whitelist for access to ApsaraDB for OceanBase, note the following rules:

      • Access from private IP addresses: The CIDR blocks specified in the whitelist must be the private IP addresses of ECS instances.

      • Access from public IP addresses: Make sure that the public IP addresses specified in the whitelist are those actually used for identifying the devices on the public network. For example, if the IP address is 127.0.0.1, no devices can access the tenant.

        For more information about how to add a whitelist group, see Whitelist group.

Check the account password

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, click Clusters.

  3. On the Clusters page, click the name of the target cluster to go to the Cluster Workspace page.

  4. In the tenant list, click the name of the target tenant to go to the Tenant Details page.

  5. In the left-side navigation pane, click Account Management.

  6. On the Account Management page, find the target account in the list, and click Change Password in the Actions column to reset the account password and retry the connection.

    Note

    When you connect to a database, avoid entering spaces at either end of the password string and make sure that no hidden characters are copied and pasted with the password.

Check the tenant mode of the connection

  1. Log on to the ApsaraDB for OceanBase console.

  2. In the left-side navigation pane, click Clusters.

  3. On the Clusters page, click the target cluster to go to the Cluster Workspace page.

  4. Click the target tenant in the Tenants list to go to the Tenant Workspace page of the Oracle or MySQL tenant.

  5. On the Tenant Workspace page, click Log On to Database to log on to OceanBase Developer Center (ODC).

  6. On the Private Connection tab of the ODC homepage, click Create Connection.

  7. Specify the region of the tenant, which is Public Cloud. Specify the connection mode, which is MySQL or Oracle.

    Note
    • MySQL tenant: The format of OBClient connection string:obclient -h[tenant domain name] -u[tenant username] -P3306 -p[tenant password]

    • The format of OBClient connection string:obclient -h[tenant domain name] -u[tenant username] -P1521 -p[tenant password]

Check the network type of the ECS client

Make sure that the network type of the ECS client is VPC.

Check the regions of the ECS client and ApsaraDB for OceanBase instances

Make sure that the ECS client and the ApsaraDB for OceanBase instances are in the same region.

Check the VPCs of the ECS client and the tenant of ApsaraDB for OceanBase

To access a tenant in an ApsaraDB for OceanBase cluster from an ECS client over a private network, make sure that the client and the tenant use the same VPC.

Note

This is required for standard cross-VPC connection where no special tools are used.

  1. View the VPC of the tenant of ApsaraDB for OceanBase.

    1. Log on to the ApsaraDB for OceanBase console.

    2. In the left-side navigation pane, click Clusters.

    3. On the Clusters page, click the name of the target cluster to go to the Cluster Workspace page.

    4. Click the target tenant in the Tenants list to go to Tenant Workspace of the Oracle or MySQL tenant.

    5. In the basic information section, view the value of User VPC.

  2. View the VPC of the ECS client.

    1. Log on to the ECS console.

    2. In the left-side navigation pane, choose Instances and Images Instances.

    3. In the Network Information section of the Instance Details tab, view the value of VPC.

  3. Make sure that the value of User VPC of the ApsaraDB for OceanBase instance is the same as the value of VPC of the ECS client.

  • On this page (0, O)
  • Error
  • Causes
  • Solutions
  • Check public and private IP addresses
  • Check whitelist settings
  • Check the account password
  • Check the tenant mode of the connection
  • Check the network type of the ECS client
  • Check the regions of the ECS client and ApsaraDB for OceanBase instances
  • Check the VPCs of the ECS client and the tenant of ApsaraDB for OceanBase
Feedback