このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

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
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
Help Center/ CloudTable Service/ User Guide/ ClickHouse User Guide/ ClickHouse Cluster Management/ Configuring Secure Channel Encryption for ClickHouse Clusters

Configuring Secure Channel Encryption for ClickHouse Clusters

Updated on 2024-12-24 GMT+08:00

You can enable secure channel encryption to encrypt data transmission. This section describes how to enable HTTPS for a ClickHouse cluster.

Enabling Channel Encryption

  1. Log in to the CloudTable console.
  2. Click in the upper left corner to select a region.
  3. Click Buy Cluster in the upper right corner.
  4. Check whether Enable Channel Encryption (which is toggled on by default) is toggled on after completing other configurations.

    Figure 1 Enabling channel encryption
    NOTE:
    • Disabling HTTPS will pose risks to enterprise services.
    • The HTTPS option is enabled during cluster creation and cannot be disabled later.
    • If the HTTPS option is not enabled during cluster creation, it cannot be enabled later.

  5. Complete the parameter setting and click Next.
  6. Confirm the cluster specification order information on the displayed page and submit the order. After the cluster is created, go to its details page to view the channel status.

Enabling Secure and Non-Secure Channels

  1. Log in to the CloudTable console.
  2. Click in the upper left corner to select a region.
  3. Click Buy Cluster in the upper right corner.
  4. Complete the parameter setting and click Next.
  5. On the displayed page, confirm the cluster specification order information and click Submit. The cluster creation task is submitted.
  6. After the cluster is created, go to its details page and toggle Enable Secure and Non-secure Channels on. In the displayed dialog box, confirm the information and click OK.

    NOTE:
    • The cluster restarts after the secure channels are enabled on the cluster details page.
    • The secure and non-secure channels cannot be disabled after being enabled concurrently.

Connecting to a Security Cluster

  1. Click the name of the target security cluster to download the certificates on its details page.
  2. Connect to the client and specify the configuration file.

    ./clickhouse client --host Private IP address of the cluster --port port --user admin --password Password --secure --config-file /root/config.xml

    Configure files.

    <config>
        <secure>true</secure>
        <openSSL>
          <client>
            <caConfig>/etc/ssl/certificate.crt</caConfig>
          </client>
        </openSSL>
    </config>
    NOTE:
    • <caConfig>/etc/ssl/certificate.crt</caConfig> indicates the path where certificates are stored.
    • root indicates the path for storing the configuration file.
    • Certificates can be downloaded only once per minute.

HTTPS Connection

  1. Click the name of the target security cluster to download the certificates on its details page.
  2. Specify the path for storing the certificates.
  3. Execute the sample SQL statement through HTTPS.

    echo 'select 1' | curl -H 'X-ClickHouse-User: user' -H 'X-ClickHouse-Key: password' --cacert /clickhouse/client/client/bin/certificate.crt 'https://host:port/?' --data-binary @-
    • select 1 indicates the executed SQL statement.
    • user indicates the username.
    • password indicates the password created during cluster creation.
    • /clickhouse/client/client/bin/certificate.crt indicates the path for storing the certificates.
    • host indicates the private IP address and port indicates the HTTPS port.

JDBC Connection

public void run()
        throws InterruptedException {
    final ClickHouseProperties clickHouseProperties = new ClickHouseProperties();
    // There will be security risks if the password used for authentication is directly written into code. Encrypt the password in the configuration file or environment variables for storage;
    // In this example, the password is stored in environment variables for identity authentication. Before running the code in this example, configure environment variable CK_PASSWORD.
    String password = System.getenv("CK_PASSWORD");
    clickHouseProperties.setSslRootCertificate("/etc/ssl/certificate.crt");
    clickHouseProperties.setSsl(true);
    clickHouseProperties.setSslMode("strict");
    clickHouseProperties.setUser("test");
    clickHouseProperties.setPassword(password);
    clickHouseProperties.setSocketTimeout(2 * 3600 * 1000);
    final BalancedClickhouseDataSource dataSource = new BalancedClickhouseDataSource("xxxx.mycloudtable.com:8443/default?ssl=true", clickHouseProperties);
    try {
        final ClickHouseConnection conn = dataSource.getConnection();
        conn.createStatement().executeQuery("select now()");
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
NOTE:

/etc/ssl/certificate.crt in clickHouseProperties.setSslRootCertificate("/etc/ssl/certificate.crt"); indicates the path for storing the certificates.

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