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

Connecting to an Instance over a Public Network

This section uses the Linux operating system as an example to describe how to connect an ECS to a GeminiDB Influx instance over a public network.

Prerequisites

  • Bind an EIP to the GeminiDB Influx instance and configure security group rules to ensure that the instance is accessible from ECSs through the EIP. For details, see Binding and Unbinding an EIP and Configuring Security Group Rules.
  • 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.
  • Download the InfluxDB client. The following uses the Linux 64-bit client as an example.

Procedure

  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.
      • Use SSL to connect to a database.

        ./influx -ssl -unsafeSsl -host <DB_HOST> -port <DB_PORT>

        Example:

        ./influx -ssl -unsafeSsl -host 10.xx.xx.xx -port 8635

      • Use a non-SSL connection to access a database.

        ./influx -host <DB_HOST> -port <DB_PORT>

        Example:

        ./influx -host 10.xx.xx.xx -port 8635

      Table 1 Parameter description

      Parameter

      Description

      <DB_HOST>

      Specifies the EIP of the node to be connected.

      To obtain this IP address, go to the Instances page and click the target DB instance name. The IP address can be found in the EIP field under Node Information on the Basic Information page.

      If the instance you purchased has multiple nodes, select the EIP of any node.

      If no EIP has been bound to the current node, bind an EIP to the instance by referring to Binding and Unbinding an EIP.

      <DB_PORT>

      The port of the instance to be connected. The default value is 8635 and cannot be changed.

      Click the instance to go to the Basic Information page. In the Network Information area, you can find the database port.

    3. Run the following command for authentication:

      auth

      Enter the username and password as prompted.

      username:<DB_USER>

      password:<DB_PWD>

      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

  5. After the identity verification is successful, run the following command:

    show database

    If the following information is displayed, the connection is successful.

    name: databases
    name
    ----
    _internal

Follow-up Operations

After you log in to the instance, you can create databases or data retention policies. For details, see Buying and Connecting to a GeminiDB Influx Instance.