Help Center/ MapReduce Service/ Developer Guide (LTS)/ IoTDB Development Guide (Security Mode)/ IoTDB Application Commissioning/ Commissioning the IoTDB Application in the Local Windows Environment
Updated on 2025-04-14 GMT+08:00

Commissioning the IoTDB Application in the Local Windows Environment

Scenario

Run applications in a Windows development environment after application code is developed. If the local and cluster service planes can communicate with each other, you can perform the commissioning on the local host.

  • If the IBM JDK is used in the Windows environment, applications cannot be directly run in the Windows environment.
  • You need to set the mapping between the host names and IP addresses of the access nodes in the hosts file on the local host where the sample code is run. The host names and IP addresses must be mapped one by one.

Procedure

  1. Click Reimport All Maven Projects in the Maven window on the right of the IDEA to import the Maven project dependency.

    Figure 1 reimport projects

  2. Compile and run the application.

    Modify the IP address, port number, login username, and password of the IoTDBServer node that matches the code.

    1. Use either of the following two methods:
      • Method 1

        Choose Maven > Sample project name > Lifecycle > clean and double-click clean to run the clean command of Maven.

        Choose Maven > Sample project name > Lifecycle > compile and double-click compile to run the compile command of Maven.

        Figure 2 Maven tools clean and compile
      • Method 2

        Go to the directory where the pom.xml file is located in the Terminal window in the lower part of the IDEA, and run the mvn clean compile command to compile the pom.xml file.

        Figure 3 Enter mvn clean compile in the IDEA Terminal text box.

        After the compilation is complete, the message "BUILD SUCCESS" is displayed.

        Figure 4 Compilation completed
    2. Run the application. A JDBC application is used as an example. The operations for running other applications are the same.

      Right-click the JDBCExample.java file and choose Run 'JDBCExample.main() from the shortcut menu.

      Figure 5 Running the application

Viewing Commissioning Results

After the IoTDB application is run, you can view the running results in IntelliJ IDEA.

  • The running result of the JDBCExample example application is as follows:
    ...
    --------------------------
    Time root.sg.d1.s1 root.company.line2.device1.temperature root.company.line2.device1.speed root.company.line2.device2.speed root.company.line2.device2.status root.company.line1.device1.spin root.company.line1.device1.status root.company.line1.device2.temperature root.company.line1.device2.power root.sg1.d1.s3 root.sg1.d1.s1 root.sg1.d1.s2 
    0, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    1, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    2, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    3, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    4, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    5, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    6, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    7, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    8, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    9, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    10, null, null, null, null, null, null, null, null, null, 1.0, 1.0, 1.0
    --------------------------
    
    --------------------------
    count(root.sg.d1.s1) count(root.company.line2.device1.temperature) count(root.company.line2.device1.speed) count(root.company.line2.device2.speed) count(root.company.line2.device2.status) count(root.company.line1.device1.spin) count(root.company.line1.device1.status) count(root.company.line1.device2.temperature) count(root.company.line1.device2.power) count(root.sg1.d1.s3) count(root.sg1.d1.s1) count(root.sg1.d1.s2) 
    8237, 1, 1, 1, 1, 1, 1, 1, 1, 101, 101, 101
    --------------------------
    
    --------------------------
    Time count(root.sg.d1.s1) count(root.company.line2.device1.temperature) count(root.company.line2.device1.speed) count(root.company.line2.device2.speed) count(root.company.line2.device2.status) count(root.company.line1.device1.spin) count(root.company.line1.device1.status) count(root.company.line1.device2.temperature) count(root.company.line1.device2.power) count(root.sg1.d1.s3) count(root.sg1.d1.s1) count(root.sg1.d1.s2) 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 19, 19
    20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20
    40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20
    60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20
    80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20
    --------------------------
  • The running result of the FlinkIoTDBSink example application is as follows:
    ...
    19:53:41.532 [flink-akka.actor.default-dispatcher-9] DEBUG org.apache.flink.runtime.resourcemanager.StandaloneResourceManager - Received heartbeat from 5153e4ff24b25b13225f1bf67a4312d8.
    19:53:41.800 [flink-akka.actor.default-dispatcher-9] DEBUG org.apache.flink.runtime.jobmaster.JobMaster - Trigger heartbeat request.
    19:53:41.800 [flink-akka.actor.default-dispatcher-10] DEBUG org.apache.flink.runtime.taskexecutor.TaskExecutor - Received heartbeat request from 5153e4ff24b25b13225f1bf67a4312d8.
    19:53:41.802 [flink-akka.actor.default-dispatcher-9] DEBUG org.apache.flink.runtime.jobmaster.JobMaster - Received heartbeat from 7d6ef313-3f78-4cee-bbb1-e234dcac6d30.
    19:53:42.988 [pool-3-thread-1] DEBUG org.apache.iotdb.flink.IoTDBSink - send event successfully
    19:53:42.988 [pool-6-thread-1] DEBUG org.apache.iotdb.flink.IoTDBSink - send event successfully
    19:53:42.990 [pool-4-thread-1] DEBUG org.apache.iotdb.flink.IoTDBSink - send event successfully
    19:53:45.990 [pool-7-thread-1] DEBUG org.apache.iotdb.flink.IoTDBSink - send event successfully
    19:53:45.992 [pool-9-thread-1] DEBUG org.apache.iotdb.flink.IoTDBSink - send event successfully
    19:53:45.994 [pool-5-thread-1] DEBUG org.apache.iotdb.flink.IoTDBSink - send event successfully
  • The running result of the IoTDB Kafka example application is as follows:
    • Producer.java
      ...
      [2022-01-15 15:12:34,221] INFO New Producer: start. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:12:39,369] INFO [Producer clientId=DemoProducer] Cluster ID: uDtuaWS_QUK02EtuZQ4Xew (org.apache.kafka.clients.Metadata)
      [2022-01-15 15:12:57,077] INFO The Producer have send 100 messages. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:13:04,691] INFO The Producer have send 200 messages. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:13:11,355] INFO The Producer have send 300 messages. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:13:17,758] INFO The Producer have send 400 messages. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:13:24,335] INFO The Producer have send 500 messages. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:13:30,739] INFO The Producer have send 600 messages. (com.huawei.bigdata.iotdb.Producer)
      [2022-01-15 15:13:37,267] INFO The Producer have send 700 messages. (com.huawei.bigdata.iotdb.Producer)
    • KafkaConsumerMultThread.java
      ...
      [2022-01-15 15:19:27,563] INFO Consumer Thread-1 partitions:1 record: sensor_29,1642231023769,1.000000 offsets: 828 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,612] INFO Consumer Thread-1 partitions:1 record: sensor_31,1642231023769,1.000000 offsets: 829 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,612] INFO Consumer Thread-0 partitions:0 record: sensor_8,1642231023769,1.000000 offsets: 842 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,665] INFO Consumer Thread-1 partitions:1 record: sensor_32,1642231023769,1.000000 offsets: 830 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,665] INFO Consumer Thread-0 partitions:0 record: sensor_9,1642231023769,1.000000 offsets: 843 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,732] INFO Consumer Thread-1 partitions:1 record: sensor_33,1642231023769,1.000000 offsets: 831 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,732] INFO Consumer Thread-0 partitions:0 record: sensor_11,1642231023769,1.000000 offsets: 844 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,786] INFO Consumer Thread-0 partitions:0 record: sensor_12,1642231023769,1.000000 offsets: 845 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)
      [2022-01-15 15:19:27,786] INFO Consumer Thread-1 partitions:1 record: sensor_35,1642231023769,1.000000 offsets: 832 (com.huawei.bigdata.iotdb.KafkaConsumerMultThread)