Updated on 2023-11-21 GMT+08:00

Connecting to an Instance Using a Load Balancer Address (Recommended)

Scenarios

This section uses the Linux operating system as an example to describe how to connect an ECS to a GeminiDB Influx instance using a load balancer IP address.

Precautions

  • The DB instances must be in the same VPC and subnet as the ECS.
  • The ECS must be in a security group that has access to the instances.
    • If the instance is associated with the default security group, you do not need to configure security group rules.
    • If the instance is not associated with the default security group, check whether the security group rules allow the ECS to connect to the instance. For details, see Configuring Security Group Rules.

Prerequisites

  • An ECS has been created. The following uses a Linux ECS as an example. For details, see Purchasing an ECS in Getting Started with Elastic Cloud Server.
  • You have downloaded and installed the InfluxDB client on a Linux 64-bit ECS.

SSL Connection

  1. Log in to the ECS. For details, see Logging In to an ECS in Getting Started with Elastic Cloud Server.
  2. Upload the InfluxDB client installation package to the ECS using file transfer tools like XFTP.
  3. Decompress the client tool package.

    tar -xzf influxdb-1.7.9-static_linux_amd64.tar.gz

  4. Connect to the DB instance in the directory where the influx tool is located.

    1. Run the following command to go to the InfluxDB directory:

      cd influxdb-1.7.9-1

    2. Connect to a GeminiDB Influx instance.

      ./influx -ssl -unsafeSsl -username '<DB_USER>' -password '<DB_PWD>' -host <DB_HOST> -port <DB_PORT>

      Example:

      ./influx -ssl -unsafeSsl -username 'rwuser' -password '<DB_PWD>' -host 192.xx.xx.xx -port 8635

      Table 1 Parameter description

      Parameter

      Description

      <DB_USER>

      Username of the administrator account. The default value is rwuser.

      On the Instances page, click the target DB instance. In the DB Information area on the Basic Information page, you can find the administrator username.

      <DB_PWD>

      Administrator password

      <DB_HOST>

      Load balancer IP address of the instance to be connected.

      The load balancer IP address is in the open beta test (OBT) phase. To use it, contact customer service.

      Scenario 1:

      If you have enabled the load balancer address before creating an instance, you can view that the load balancer address is selected by default on the instance creation page.

      After the instance is created, click the instance name to go to the Basic Information page and obtain the load balancer address in the Network Information area.

      Scenario 2:

      If you have already created an instance, you can contact customer service to enable the load balancer IP address for the instance.

      Then you can click the instance name to view the load balancer address in the Network Information area on the Basic Information page.

      <DB_PORT>

      Port for accessing the instance.

      You can click the name of the instance to go to the Basic Information page. In the Network Information area, view the port number.

  5. Check the results. If information similar to the following is displayed, the connection is successful.

    Connected to https://host:port version 1.7.4
    InfluxDB shell version: 1.7.9
    >

Non-SSL Connection

  1. Log in to the ECS. For details, see Logging In to an ECS in Getting Started with Elastic Cloud Server.
  2. Upload the InfluxDB client installation package to the ECS using file transfer tools like XFTP.
  3. Decompress the client tool package.

    tar -xzf influxdb-1.7.9-static_linux_amd64.tar.gz

  4. Connect to the DB instance in the directory where the influx tool is located.

    1. Run the following command to go to the InfluxDB directory:

      cd influxdb-1.7.9-1

    2. Connect to a GeminiDB Influx instance.

      ./influx -username '<DB_USER>' -password '<DB_PWD>' -host <DB_HOST> -port <DB_PORT>

      Example:

      ./influx -username 'rwuser' -password '<DB_PWD>' -host 192.xx.xx.xx -port 8635

      Table 2 Parameter description

      Parameter

      Description

      <DB_USER>

      Username of the administrator account. The default value is rwuser.

      On the Instances page, click the target DB instance. In the DB Information area on the Basic Information page, you can find the administrator username.

      <DB_PWD>

      Administrator password

      <DB_HOST>

      Load balancer IP address of the instance to be connected.

      The load balancer IP address is in the open beta test (OBT) phase. To use it, contact customer service.

      • If you have enabled the load balancer address before creating an instance, you can view that the load balancer address is selected by default on the instance creation page.

        After the instance is created, click the instance name to go to the Basic Information page and obtain the load balancer address in the Network Information area.

      • If you have already created an instance and enabled the load balancer address, you can click the instance name and view the address in the Network Information area on the Basic Information page.

      <DB_PORT>

      Port for accessing the instance.

      You can click the name of the instance to go to the Basic Information page. In the Network Information area, view the port number.

  5. Check the results. If information similar to the following is displayed, the connection is successful.

    Connected to https://host:port version 1.7.4
    InfluxDB shell version: 1.7.9
    >