El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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

Importing and Configuring ClickHouse Sample Projects

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

Context

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

Prerequisites

Ensure that the difference between the local PC time and the cluster time is less than 5 minutes. If the time difference cannot be determined, contact the system administrator. You can view the time of the cluster in the lower-right corner on the FusionInsight Manager page.

Scenarios

ClickHouse provides sample projects for multiple scenarios to help you quickly learn ClickHouse projects.

Procedure

  1. Obtain the sample project folder clickhouse-examples and Maven configurations in the src directory where the sample code is decompressed. For details, see Obtaining the MRS Application Development Sample Project.
  2. In the application development environment, import the sample project to the IntelliJ IDEA development environment.

    1. On the IDEA page, choose File > New > Project from Existing Sources.

    2. In the displayed Select File or Directory to Import dialog box, select the pom.xml file in the clickhouse-examples folder and click OK.
    3. Confirm subsequent configurations and click Next. If there is no special requirement, use the default values.
    4. Select the recommended JDK version and click Finish.

  3. After the project is imported, modify the clickhouse-example.properties file in the conf directory of the sample project based on the actual environment information.

    loadBalancerIPList=
    sslUsed=false
    loadBalancerHttpPort=21425
    loadBalancerHttpsPort=21426
    CLICKHOUSE_SECURITY_ENABLED=true
    user=
    # Passwords stored in plaintext pose security risks. Store them in ciphertext in configuration files or environment variables.
    password=
    clusterName=default_cluster
    databaseName=testdb
    tableName=testtb
    batchRows=10000
    batchNum=10

    Table 1 Configuration description

    Parameter

    Default Value

    Definition

    loadBalancerIPList

    -

    Mandatory. Set this parameter to the IP address list of LoadBalance.

    Log in to FusionInsight Manager, choose Cluster > Services > ClickHouse > Instance, and check the service IP addresses of all ClickHouseBalancer instances.

    Use commas (,) to separate multiple IP addresses, for example, 10.10.10.100,10.10.10.101.

    sslUsed

    false

    Whether to enable SSL encryption. You are advised to set this parameter to true for clusters in security mode.

    loadBalancerHttpPort

    21425

    HTTP port number of LoadBalance.

    Log in to FusionInsight Manager, choose Cluster > Services > ClickHouse > Instance, click the corresponding ClickHouseBalancer instance, choose Instance Configurations > All Configurations, search for lb_http_port, and obtain the parameter value. The default value is 21425.

    loadBalancerHttpsPort

    21426

    HTTPS port number of LoadBalance. If sslUsed is set to true, this parameter cannot be empty.

    Log in to FusionInsight Manager, choose Cluster > Services > ClickHouse > Instance, click the corresponding ClickHouseBalancer instance, choose Instance Configurations > All Configurations, search for lb_https_port, and obtain the parameter value. The default value is 21426.

    CLICKHOUSE_SECURITY_ENABLED

    true

    Whether to enable the security mode. Set this parameter to false for a cluster in normal mode.

    user

    No default value

    Developer user created in Table 1.

    password

    No default value

    Password of the development user

    Passwords stored in plaintext pose security risks. Store them in ciphertext in configuration files or environment variables.

    NOTE:

    If the user is created on FusionInsight Manager, you need to change the initial password upon the first login.

    clusterName

    default_cluster

    ClickHouse logical cluster name. Retain the default value.

    databaseName

    testdb

    Name of the database to be created in the sample code project. You can change the database name based on the site requirements.

    tableName

    testtb

    Name of the table to be created in the sample code project. You can change the table name based on the site requirements.

    batchRows

    10000

    Number of data records written in a batch.

    batchNum

    10

    Total number of batches in which data is written.

    NOTE:

    Although ClickHouse has the cluster capability, it does not have a unified access entry. The client needs to directly detect all nodes in the cluster. This is not easy to use. ClickHouse uses the LoadBalance-based deployment architecture to automatically distribute user access traffic to multiple backend nodes, expanding service capabilities to external systems and improving fault tolerance. When a client application requests a cluster, Nginx-based ClickHouseBalancer is used to distribute traffic. In this way, data read/write load and high availability of application access are guaranteed.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback