Configuring and Importing SpringBoot Sample Projects
Background
To run the SpringBoot API sample code of the Doris component of MRS, perform the following operations:
This section describes how to develop an application that connects to the Doris service in SpringBoot mode in Windows.
Procedure
- Obtain the sample project folder doris-rest-client-example in the src/springboot/doris-examples directory in the sample code decompression directory by referring to Obtaining the MRS Application Development Sample Project.
- In the application development environment, import the sample project to the IntelliJ IDEA development environment.
- Choose File > New > Project from Existing Sources.

- In the Select File or Directory to Import dialog box, select the pom.xml file in the doris-rest-client-example folder and click OK.
- Confirm the subsequent configuration and click Next. If there is no special requirement, use the default value.
Select the recommended JDK version and click Finish.
- This section describes how to develop an application that connects to the Doris service in SpringBoot mode in Windows.
- Versions prior to MRS 3.5.0-LTS:
- Set the DORIS_MY_USER and DORIS_MY_PASSWORD environment variables in the local environment variables. Store the environment variables in ciphertext and decrypt the environment variables to ensure security.
- DORIS_MY_USER indicates the user name for logging in to the Doris.
- DORIS_MY_PASSWORD indicates the password for logging in to the Doris.
- After the jdbc-example sample project is imported, modify the following parameters:
- In the code, change xxx in HOST = "xxx" to the IP address of the master FE node of the Doris. To obtain the IP address of the master FE node, choose Cluster > Services > Doris on Manager and view the Host Where Leader Locates.
- In the code, change xxx where PORT = "xxx" to the MySQL query connection port of Doris. The default port is 29982. To obtain the port, log in to FusionInsight Manager, choose Cluster > Services > Doris > Configurations, and search for query_port.
- Set the DORIS_MY_USER and DORIS_MY_PASSWORD environment variables in the local environment variables. Store the environment variables in ciphertext and decrypt the environment variables to ensure security.
- Versions prior to MRS 3.5.0-LTS, after the doris-rest-client-example sample project is imported, modify the following parameters:
- In the code, change xxx in HOST = "xxx" to the IP address of the master FE node of the Doris. To obtain the IP address of the master FE node, choose Cluster > Services > Doris on Manager and view the Host Where Leader Locates.
- In the code, change xxx where PORT = "xxx" to the MySQL query connection port of Doris. The default port is 29982. To obtain the port, log in to FusionInsight Manager, choose Cluster > Services > Doris > Configurations, and search for query_port.
- Choose File > New > Project from Existing Sources.
- MRS 3.5.0-LTS and later versions, after the sample project is imported, modify the parameters in the src/main/resources/conf.properties file in the sample folder for subsequent running of the sample project.
HOST=127.0.0.1 QUERY_PORT=29982 JDBC_DRIVER=com.mysql.cj.jdbc.Driver USER= PASSWD= PORT=29991
- You can log in to FusionInsight Manager, choose Cluster > Services > Doris, and obtain the values of the following parameters.
- HOST indicates the IP address of the master FE node of Doris. You can obtain the value from the Host Where Leader Locates on the Dashboard sheet of the Doris service.
- Query_PORT indicates the MySQL protocol query connection port of Doris. To obtain the port, click Configurations and search for query_port.
- Port: port number for accessing the FE. To obtain the port number, click Configurations and search for https_port.
- USER and PASSWD are the username and password obtained in section Preparing a Developer Account.
- You can log in to FusionInsight Manager, choose Cluster > Services > Doris, and obtain the values of the following parameters.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot