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
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
On this page

Show all

Configuring and Importing a Sample Projects

Updated on 2024-08-10 GMT+08:00

Context

Obtain the IoTDB development sample project and import the project to IntelliJ IDEA to learn the sample project.

Procedure

  1. Obtain the sample project from the src/iotdb-examples directory in the directory where the sample code is decompressed by referring to Obtaining the MRS Application Development Sample Project. You can select a sample based on the actual service scenario. For details about the samples, see IoTDB Sample Project.
  2. To debug iotdb-flink-example, iotdb-jdbc-example, iotdb-kafka-example, or iotdb-session-example sample code on the local Windows environment, perform the following operations:

    • Store the authentication files user.keytab and krb5.conf obtained in Preparing for User Authentication and SSL certificate file truststore.jks to the ..\src\main\resources directory of each sample project.
    • Configure the com.huawei.bigdata.iotdb.IoTDBProperties class in the ..\src\main\resources directory of each sample project, change the value of proPath in the IoTDBProperties() method to the absolute path of the iotdb-example.properties file.
      Figure 1 Configuring the proPath parameter

  3. Modify the iotdb-example.properties file in the ..\src\main\resources directory of each sample project.

    iotdb_ssl_enable=true
    jdbc_url=jdbc:iotdb://IP address of the IoTDBServer instance:IoTDBServer RPC port
    # Username for authentication
    username=developuser
    # User password for authentication. It is recommended that the password be stored in ciphertext and decrypted when being used.
    password=xxx
    # Location of the krb5.conf file in the downloaded authentication credential. In Linux, you are advised to use the krb5.conf file that has been uploaded to the IoTDB client installation directory/IoTDB/iotdb/conf directory. In Windows, use \\ to specify the absolute path of the file.
    krb5_conf_dest=IoTDB client installation directory/iotdb/conf/krb5.conf
    # Location of the user.keytab file in the downloaded authentication credential. In Linux, you are advised to use the user.keytab file that has been uploaded to the IoTDB client installation directory/IoTDB/iotdb/conf directory. In Windows, use \\ to specify the absolute path of the file.
    key_tab_dest=IoTDB client installation directory/IoTDB/iotdb/conf/user.keytab
    # Username corresponding to user.keytab followed by @HADOOP.COM
    client_principal=developuser@HADOOP.COM
    # Location of the truststore file. In Linux, you are advised to use the truststore.jks file that has been uploaded to the IoTDB client installation directory/IoTDB/iotdb/conf directory. In Windows, use \\ to specify the absolute path of the file.
    iotdb_ssl_truststore=IoTDB client installation directory/IoTDB/iotdb/conf/truststore.jks

  4. After the IntelliJ IDEA and JDK tools are installed, configure the JDK in IntelliJ IDEA.

    1. Start IntelliJ IDEA and choose Configure.
      Figure 2 Quick Start
    2. Select Structure for New Projects from the drop-down list.
      Figure 3 Configure
    3. On the displayed Project Structure for New Projects page, select SDKs, click the plus sign (+), and click JDK.
      Figure 4 Project Structure for New Projects
    4. On the Select Home Directory for JDK page that is displayed, select the JDK directory and click OK.
      Figure 5 Select Home Directory for JDK
    5. After selecting the JDK, click OK to complete the configuration.
      Figure 6 Completing the JDK configuration
      NOTE:

      The operation procedure may vary according to the IDEA version.

  5. Import the sample project to the IntelliJ IDEA development environment.

    1. Start the IntelliJ IDEA, and click Open or Import on the quick start page.

      For the IDEA tool that has been used, you can choose File > Import project... on the main interface to import the sample project.

      Figure 7 Open or Import (quick start page)
    2. Select the pom.xml file of iotdb-jdbc-example in the sample project folder iotdb-examples, and click OK.

      Select Open as Project.

    3. After the import is complete, check that the imported sample projects are displayed on the IDEA home page.
      Figure 8 Successfully importing sample projects

  6. Set the Maven version used by the project.

    1. Choose File > Settings... from the main menu of IntelliJ IDEA.
      Figure 9 Settings
    2. Choose Build, Execution, Deployment > Maven and set Maven home directory to the Maven version installed on the local host.
      Configure User settings file and Local repository based on the site requirements.
      Figure 10 Selecting the local Maven installation directory
    3. Click Apply and OK to complete the configuration.

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