Updated on 2023-12-07 GMT+08:00

Forwarding Data to GeminiDB Influx

Scenarios

Forward data to InfluxDB and cloud-native time series database with full compatibility with InfluxDB. GaussDB(for Influx) reads and writes time series data with high performance and compression ratio in high concurrency scenarios, provides cold and hot tiered storage, elastic scale-out, and monitoring and alarm reporting. It stores the data with compression algorithms, allows you to query data using SQL-like statements, and supports multi-dimensional aggregation computing and visual analysis. It is widely used to monitor resources, services, IoT devices, and industrial production processes, evaluate production quality, and trace faults. GaussDB(for Influx) can achieve very high throughput and concurrency, so it can handle a large number of connections in a very short period of time, making it an excellent choice for IoT applications.

Buying GeminiDB Influx Instances

  1. Log in to GeminiDB Influx and click Buy Now.
  2. Select either of the Pay-per-use or Yearly/Monthly as the Billing Mode, configure specifications and storage space as required, and set Compatible API to InfluxDB. For details, see Buying a Cluster Instance.

    Figure 1 Buying an InfluxDB Instance

  3. Download the InfluxDB client and connect to a DB instance through the client by referring to Connecting to an Instance over a Public Network.
  4. After connecting to the instance through the client, run the following command to create a database. ${databaseName} can be customized.

    create database ${databaseName}
    Figure 2 Creating a database

Configuring IoTDA

You can configure data forwarding rules in IoTDA to forward data reported by devices to InfluxDB.

  1. Go to the IoTDA service page and click Access Console.
  2. In the navigation pane, choose Rules > Data Forwarding, and click Create Rule in the upper left corner.
  3. Set the parameters based on the table below. The following parameter values are only examples. You can create a rule by referring to Data Forwarding Overview and click Create Rule.

    Table 1 Rule parameters

    Parameter

    Description

    Rule Name

    Customize a name, for example, iotda-InfluxDB.

    Description

    Enter a rule description, for example, forwarding data to InfluxDB.

    Data Source

    Select Device.

    Trigger

    Device added is automatically configured.

    Resource Space

    Select All resource spaces.

  4. Click the Set Forwarding Target tab, click Add to set a forwarding target, and click OK.

    Table 2 Forwarding target parameters

    Parameter

    Description

    Forwarding Target

    Select Time series database InfluxDB.

    Database Instance Address

    Enter the connection address of influx you purchased.

    Database Name

    Enter the name of the database created in InfluxDB.

    Access Account

    Enter the InfluxDB account name.

    Access Password

    Password of the InfluxDB.

  5. Set the target fields and click OK to complete configuration.

    Table 3 Field mapping parameters

    Parameter

    Description

    Save To

    Enter the table name, which is user-defined.

    Field Mappings

    Configure the field mappings. You can customize the target field and configure the forwarding field by referring to Push a Device Addition Notification.

    Figure 3 Creating a forwarding target

    Figure 4 Configuring field mappings

  6. Click Enable Rule to activate the configured data forwarding rule.

Verifying Configurations

Access the IoTDA management console and create a device.

Expected result:

Log in to InfluxDB through the client. Access the database and query data.

show databases //Query the database.
use mysql //Switch the database.
select * from demo //Query data.
Figure 5 Test message