Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ GeminiDB/ GeminiDB Influx API/ Best Practices/ Buying and Connecting to a GeminiDB Influx Instance

Buying and Connecting to a GeminiDB Influx Instance

Updated on 2025-01-24 GMT+08:00

This section describes how to buy a GeminiDB Influx instance and uses a Linux ECS as an example to describe how to connect to the instance over a private network.

Step 1: Buy a GeminiDB Influx Instance

  1. Log in to the Huawei Cloud console.
  2. In the service list, choose Databases > GeminiDB Influx API.
  3. On the Instances page, click Buy DB Instance.
  4. Click Buy DB Instance, select a billing mode, and configure instance parameters. Then, click Next and complete subsequent operations.

    Figure 1 Basic information

    Figure 2 Selecting specifications

    Figure 3 Network settings

    Figure 4 Setting a password

  5. View the purchased GeminiDB Influx instance.

    Figure 5 Successful purchase

Step 2: Buy an Instance

  1. Log in to the Huawei Cloud console.
  2. In the service list, choose Compute > Elastic Cloud Server. On the Elastic Cloud Server console, click Buy ECS.

  3. Configure basic settings and click Next: Configure Network. Make sure that the ECS is in the same region, AZ, VPC, and security group as the GeminiDB Influx instance you created.

    Figure 6 Basic settings
    Figure 7 Selecting specifications
    Figure 8 Selecting an image

  4. Configure the ECS network and click Next: Configure Advanced Settings. Make sure that the ECS is in the same VPC and security group as the GeminiDB Influx instance.

    • If security group rules allow access from the ECS, you can connect to the instance using the ECS.
    • If the security group rules do not allow access from the ECS, add an inbound rule to the security group.
    Figure 9 Network settings
    Figure 10 Selecting an EIP

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

    Figure 11 Advanced settings

  6. Confirm the configurations and click Submit.

    Figure 12 Confirming the configurations

  7. View the purchased ECS.

Step 3: Connect to the GeminiDB Influx Instance

  1. On the ECS console, log in to the ECS using the remote login option.

    Figure 13 Remote login

  2. Enter the username and password of the ECS.

    Figure 14 Entering the username and password

  3. Obtain the x86 or Arm InfluxDB client.

    Download the x86 or Arm InfluxDB client and upload the InfluxDB client installation package to the ECS.

  4. Decompress the client tool package (the x86 client is used as an example).

    tar -xzf influxdb-1.8.10_linux_amd64.tar.gz

  5. Connect to your instance in the directory where the InfluxDB client is located.

    1. Run the following command to go to the InfluxDB directory:
      cd influxdb-1.8.10-1/usr/bin
    2. Connect to the 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 Required description

      Parameter

      Description

      <DB_USER>

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

      On the Instances page, locate the instance and click its name. In the DB Information area on the Basic Information page, you can find the administrator username.

      <DB_PWD>

      Administrator password

      <DB_HOST>

      Load balancer address of the instance to be connected.

      A load balancer address is in the open beta test (OBT) phase. To use it, choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact customer service.

      Scenario 1:

      If you have obtained a 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 its name to go to the Basic Information page and obtain the load balancer IP address in the Network Information area.

      Scenario 2:

      To use a load balancer address after the instance is created, choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact customer service.

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

      <DB_PORT>

      Port for accessing the instance.

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

  6. If information similar to the following is displayed, the connection was successful.

    Connected to https://host:port version x.x.x
    InfluxDB shell version: 1.8.10
    >

Basic Syntax

  • Database syntax
    • Create a database.

      create_database_stmt = "CREATE DATABASE" db_name

      [ WITH

      [ retention_policy_duration ]

      [ retention_policy_replication ]

      [ retention_policy_shard_group_duration ]

      [ retention_policy_name ]

      ] .

      NOTE:

      The commands in square brackets ([]) are optional.

      Example:

      • Creating database mydb

        CREATE DATABASE "mydb"

      • Creating database mydb, configuring retention policy myrp to retain data for 1 day, keeping 1 a copy, and setting the storage duration for shardGroup to 30 minutes

        CREATE DATABASE "mydb" WITH DURATION 1d REPLICATION 1 SHARD DURATION 30m NAME "myrp"

      • Creating database mydb and using the default retention policy, myrp

        CREATE DATABASE "mydb" WITH NAME "myrp"

    • Query databases.

      SHOW DATABASES

    • Switch to another database.

      USE db_name

    • Delete a database.

      DROP DATABASE "db_name"

  • RETENTION POLICY
    • Create a retention policy and ensure that the policy name does not contain periods (,), colons (:), semicolons (;), or dots (.).

      create_retention_policy_stmt = "CREATE RETENTION POLICY" policy_name on_clause

      retention_policy_duration

      retention_policy_replication

      [ retention_policy_shard_group_duration ]

      [ "DEFAULT" ] .

      NOTE:

      The commands in square brackets ([]) are optional.

      Example:

      • Creating a data retention policy

        CREATE RETENTION POLICY "10m_events" ON "somedb" DURATION 60m REPLICATION 2

      • Creating a data retention policy and setting it as the default retention policy

        CREATE RETENTION POLICY "10m_events" ON "somedb" DURATION 60m REPLICATION 2 DEFAULT

      • Creating a data retention policy and specifying the storage duration for shardGroup

        CREATE RETENTION POLICY "10m_events" ON "somedb" DURATION 60m REPLICATION 2 SHARD DURATION 30m

    • View a retention policy.

      show retention policies on <database name>

      NOTE:

      If you specify both parameters retention_policy_duration and retention_policy_shard_group_duration, ensure that the former parameter has a larger value than the latter.

    • Delete a retention policy.

      DROP RETENTION POLICY policy_name ON db_name

    • Modify a retention policy.

      Alter_retention_policy_stmt = "ALTER RETENTION POLICY" policy_name on_clause

      retention_policy_option

      [ retention_policy_option ]

      [ retention_policy_option ]

      [ retention_policy_option ] .

      NOTE:

      The commands in square brackets ([]) are optional.

      Example:

      • Modifying the default retention policy

        ALTER RETENTION POLICY "1h_cpu" ON "mydb" DEFAULT

      • Modifying the retention period and number of copies

        ALTER RETENTION POLICY "policy1" ON "somedb" DURATION 1h REPLICATION 4

  • Adding data

    insert into <retention policy> measurement,tagKey=tagValue fieldKey=fieldValue timestamp

    NOTE:

    When a data record is inserted, the system will automatically create measurements as required.

    • Use the default retention policy.

      insert demo,name=LiSi math=99,english=90,language=95

      Add a data record, where measurement is demo, tag is name, and there are three fields math, english, and language.

    • Use a specific retention policy.

      insert into rp_1_hours demo,name=ZhangSan math=99,english=90,language=95

  • Querying data
    • Query data from the default retention policy.

      select * from demo where time < xxx and time > xxx

    • Query data from a specific retention policy.

      select * from rp_1_hours.demo where time < xxx and time > xxx

      NOTE:

      Remember to specify a time range in the query statement.

  • Modifying data

    When you modify data using INSERT, if all tags and timestamps are the same, the existing data will be overwritten.

  • Deleting data

    You can create a retention policy to make data automatically deleted.

  • HELP command
    • Run the HELP command to view all supported commands.
      Figure 15 Viewing all supported commands
    • HELP <COMMAND> is used to query the usage of a command.

      Example: HELP DESC

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback