Updated on 2026-06-29 GMT+08:00

Commissioning the Doris Application in the Local Windows Environment

Scenario

After the code development is complete, you can run the application in the Windows development environment.

If the network between the local and the cluster service plane is normal, you can perform the commissioning on the local host.

  • If IBM JDK is used in the Windows development environment, the application cannot be 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.

Commissioning the Doris Application in the Local Windows Environment

  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 an application.

    Place the configuration file directory and modify the code to match the login user. See

    Figure 2 Directory list of doris-example to be compiled
    1. Compile an application.
      • 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, double click compile to run the compile command of Maven.

        Figure 3 clean and compile tools of Maven
      • 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 4 Run the mvn clean compile command to compile the file

        When the compilation is complete, the Build Success message is printed and the target directory is generated.

        Figure 5 doris-jdbc-example Compiled
        Figure 6 doris-stream-load-example Compiled (MRS 3.3.1-LTS and later versions)

        MRS 3.6.0-LTS and later versions, If the error message "Please use -source 7 or later to enable try-with-resources" is displayed during compilation, add the following content to the properties tag in the pom.xml configuration file. Add JDK 8, JDK 17, or JDK 21 as required. For example:

        <maven.compoler.source>8</maven.compoler.source>
        <maven.compoler.target>8</maven.compoler.target>
    2. Run the program.
      • Right-click the JDBCExample.java file and choose Run'JDBCExample.main()'.
        Figure 7 Run the Doris application
      • Right-click the DorisApplication.java file and choose Run 'DorisApplication'.
        Figure 8 Run the Doris SpringBoot application
      • For MRS 3.3.1-LTS and later versions, right-click the DorisStreamLoader.java file and select Run 'DorisStreamLoader.main()'.
        Figure 9 Running the Doris Stream Load Sample Program

Viewing Windows Commissioning Results

After a Doris application is run, you can check the running result through one of the following methods:
  • Viewing the IntelliJ IDEA running result.
  • Obtain the application running status from Doris logs.

The running results of each sample program are as follows:

  • After the doris-jdbc-example is successfully executed, the following information is displayed:
    2023-08-17 23:13:13,473 | INFO  | main | Start execute doris example. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:41)
    2023-08-17 23:13:13,885 | INFO  | main | Start create database. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:44)
    2023-08-17 23:13:13,949 | INFO  | main | Database created successfully. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:46)
    2023-08-17 23:13:13,950 | INFO  | main | Start create table. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:49)
    2023-08-17 23:13:14,132 | INFO  | main | Table created successfully. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:51)
    2023-08-17 23:13:14,133 | INFO  | main | Start to insert data into the table. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:54)
    2023-08-17 23:13:14,733 | INFO  | main | Inserting data to the table succeeded. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:56)
    2023-08-17 23:13:14,733 | INFO  | main | Start to query table data. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:59)
    2023-08-17 23:13:15,079 | INFO  | main | Start to print query result. | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:121)
    2023-08-17 23:13:15,079 | INFO  | main | c1  c2  c3   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:126)
    2023-08-17 23:13:15,079 | INFO  | main | 0  0  0   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 1  10  100   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 2  20  200   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 3  30  300   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 4  40  400   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 5  50  500   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 6  60  600   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,080 | INFO  | main | 7  70  700   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,081 | INFO  | main | 8  80  800   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,081 | INFO  | main | 9  90  900   | com.huawei.bigdata.doris.example.JDBCExample.query(JDBCExample.java:134)
    2023-08-17 23:13:15,081 | INFO  | main | Querying table data succeeded. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:61)
    2023-08-17 23:13:15,081 | INFO  | main | Start to delete the table. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:64)
    2023-08-17 23:13:15,114 | INFO  | main | Table deleted successfully. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:66)
    2023-08-17 23:13:15,124 | INFO  | main | Doris example execution successfully. | com.huawei.bigdata.doris.example.JDBCExample.main(JDBCExample.java:71)
    
    Process finished with exit code 0
  • Result of interconnecting Doris with SpringBoot:
    • Run the Doris JDBC sample program through Spring Boot.

      Enter http://IP address of the node that runs the sample:8080/doris/example/executesql in the address box of the browser. IDEA prints logs. The following figure shows the returned information.

      Figure 10 Doris JDBC sample runtime information
    • Run the DBalancer sample program through Spring Boot.

      Enter http://IP address of the node that runs the sample:8080/doris/example/dbalancer/executesql in the address box of the browser. IDEA prints logs. The following figure shows the returned information.

      Figure 11 DBalancer sample runtime information
  • After the doris-stream-load-example sample runs successfully, the following information is displayed:
    Versions prior to MRS 3.6.0-LTS:
    Start create database.
    Database created successfully.
    Start create table.
    Table created successfully.
    {
        "TxnId": 27,
        "Label": "3661e112-f0e9-4aaa-80c3-4c2b7aefeefb",
        "Comment": "",
        "TwoPhaseCommit": "false",
        "Status": "Success",
        "Message": "OK",
        "NumberTotalRows": 4,
        "NumberLoadedRows": 4,
        "NumberFilteredRows": 0,
        "NumberUnselectedRows": 0,
        "LoadBytes": 141,
        "LoadTimeMs": 387,
        "BeginTxnTimeMs": 58,
        "StreamLoadPutTimeMs": 137,
        "ReadDataTimeMs": 0,
        "WriteDataTimeMs": 94,
        "CommitAndPublishTimeMs": 95
    }
    curl{
        "TxnId": 27,
        "Label": "3661e112-f0e9-4aaa-80c3-4c2b7aefeefb",
        "Comment": "",
        "TwoPhaseCommit": "false",
        "Status": "Success",
        "Message": "OK",
        "NumberTotalRows": 4,
        "NumberLoadedRows": 4,
        "NumberFilteredRows": 0,
        "NumberUnselectedRows": 0,
        "LoadBytes": 141,
        "LoadTimeMs": 387,
        "BeginTxnTimeMs": 58,
        "StreamLoadPutTimeMs": 137,
        "ReadDataTimeMs": 0,
        "WriteDataTimeMs": 94,
        "CommitAndPublishTimeMs": 95
    }

    After successful execution, you can also connect to Doris from the MySQL client and run the following command to view the imported:

    select * from doris_test_sink;

    MRS 3.6.0-LTS and later versions:

    ... Stream load job result: {
        "TxnId": 17,
        "Label": "label_stream_load_400c9155-c74e-4c1c-bcfc-0aa5991d309b",
        "Comment": "",
        "TwoPhaseCommit": "false",
        "Status": "Success",
        "Message": "OK",
        "NumberTotalRows": 1,
        "NumberLoadedRows": 1,
        "NumberFilteredRows": 0,
        "NumberUnselectedRows": 0,
        "LoadBytes": 34,
        "LoadTimeMs": 361,
        "BeginTxnTimeMs": 64,
        "StreamLoadPutTimeMs": 171,
        "ReadDataTimeMs": 0,
        "WriteDataTimeMs": 47,
        "ReceiveDataTimeMs": 278,
        "CommitAndPublishTimeMs": 77
    }
     | com.example.stream.load.dorisstreamloadexample.DorisSecurityStreamLoader.testHttpsClient(DorisSecurityStreamLoader.java:198)
    Process finished with exit code 0

    Connect to Doris on the MySQL client and run the following command to view the imported data:

    select * from test_2.doris_test_sink;