Creating a ClickHouse Cluster
You can centrally manage clusters with CloudTable. A cluster is necessary for using CloudTable. This section describes how to create a cluster on the CloudTable console.
Prerequisites
- The VPC and security group of the cluster to be created must be the same as those of the ECS on the public network. Otherwise, the client cannot access the cluster.
- Before creating a cluster, you must configure inbound security group rules. For details, see "Configuring Security Group Rules" in the Elastic Cloud Server User Guide.
- Before creating a cluster, you must add the ICMP protocol to the security group rules so that you can view the status of each node by pinging the node IP address on the management plane. For details, see "Configuring Security Group Rules" in the Elastic Cloud Server User Guide.
Procedure
- Log in to the CloudTable console.
- Select a region in the upper left corner.
- Click Buy Cluster in the upper right corner.
- Configure basic cluster information by referring to the following table.
Table 1 Parameter description Parameter
Description
Region
Current working region of the cluster.
- Select the region for the cluster nodes to run.
AZ
Select the AZ associated with the cluster's region.
Billing Mode
Select Pay-per-use.
Table 2 Cluster and network configuration Parameter
Description
Name
Name of a cluster.
The cluster name must consist of 4 to 32 characters and must begin with a letter. It may include only letters, digits, and hyphens (-) but must not contain any other special characters. Additionally, the cluster name is case-insensitive.
VPC
A VPC is a secure, isolated, and logical network environment.
Retain the default settings. If there is no available VPC, click View VPC to access the VPC console and create a VPC.
Subnet
Specify a VPC subnet.
A subnet provides dedicated network resources that are isolated from other networks, improving network security.
Security Group
A security group is used to control ECS access within a security group or between security groups by defining access rules. You can define different access control rules for a security group. These rules can specify which ECS ports or protocols are accessible and can be used to control inbound and outbound network traffic of VMs. After an ECS is added to the security group, it is protected by these access control rules. ECSs that do not belong to the security group cannot communicate with ECSs in the security group.
You can use an existing security group or click View Security Group to create a new one.
For more information about security groups, see in the Virtual Private Cloud User Guide.
Database Engine
Select the type of cluster to be created.
Clickhouse Kernel Version
Retain the default settings.
Cluster HA
Enable: Two replicas are maintained for each shard, with three ZooKeeper nodes as the default.
Disable: Only one single ClickHouse node with a single shard and replica is provided for testing purposes. This configuration does not support node scale-out and cannot be used in any production environments.
NOTE:- A single-node cluster does not support scale-out or data migration.
- A single-node cluster can only be used in the non-production environment.
- Users of a single-node cluster must establish a non-replicated table.
Example of creating a table:
CREATE TABLE test_p (`EventDate` DateTime,`CounterID` UInt32,`UserID` UInt32,`ver` UInt16)ENGINE = ReplacingMergeTree()PARTITION BY sipHash64(CounterID) ORDER BY (CounterID, EventDate, intHash32(UserID))SAMPLE BY intHash32(UserID)SETTINGS index_granularity = 8192;
Single Replica and Multi Shard
- Select this option to enable single-replica and multi-shard.
- Deselect this option to disable single-replica and multi-shard.NOTE:
- Single-replica clusters do not support HA.
- Single- and dual-replica clusters cannot be converted to each other.
- If a node in a single-replica cluster is abnormal, the cluster is unavailable. This mode cannot be used in the production environment.
Table 3 Compute node parameters Parameter
Description
Compute
Select proper compute specifications based on service requirements. Each specification displays the CPU, memory, and recommended application scenarios of a single node.
NOTE:Available compute specifications:
- 8U16G
- 8U32G
- 16U32G
- 16U64G
- 32U64G
- 32U128G
- 64U128G
- 64U256G
Storage
Select the disk specifications and capacity of the Clickhouse compute node.
- Available storage specifications:
- High I/O
- Ultra-high I/O
- Extreme SSD
- The capacity ranges from 100 GB to 10,000 GB per node.
Nodes
Set the number of nodes in a cluster. The value ranges from 2 to 40.
Table 4 ZooKeeper node parameters Parameter
Description
Compute
Select proper compute specifications based on service requirements. Each specification displays the CPU, memory, and recommended application scenarios of a single node.
NOTE:Available compute specifications:
- 4U8G (This specification is not available for production environments.)
- 4U16G
- 8U32G
- 16U64G
- 32U128G
The ZooKeeper specifications include only 4U8G (4 vCPUs, 8 GB memory) and 4U16G. In the production environment, you are advised to select 8 vCPUs, 32 GB memory, or higher specifications.
Storage
Ultra-high I/O is recommended. Set the disk capacity to 100 GB per node.
Nodes
Number of nodes in a cluster. The default value is 3.
Table 5 Password setting parameters Parameter
Description
Username
Management user, which is used to connect to the cluster. The default value is admin and cannot be changed.
Password
Set the password of the admin user.
The password complexity requirements are as follows:
- The password must contain 8 to 16 characters.
- The password must contain at least four types of the following characters: uppercase and lowercase letters, digits, and special characters ($@!%*?&).
- The password cannot be the same as the username or the username spelled backwards.
- The strong and weak password check should be performed.NOTE:
Change the password regularly and keep it secure.
Confirm Password
Set the password of the admin user.
Enable Channel Encryption
This function uses HTTPS ports and secure TCP ports to access ClickHouse, ensuring that customer communication data is encrypted.
- If the secure channel encryption option is enabled during cluster creation, it cannot be disabled later.
- If the secure channel encryption option is not enabled for the ZooKeeper node selected during cluster creation, you can enable it on the cluster details page later.
Enterprise Project
You can group related cloud resources (for example, resources used for the same purpose) and manage them by enterprise project.
NOTE:- You can delete a user that was authorized to manage an enterprise project if the enterprise's business has changed and the user should not have the permissions to manage the enterprise project.
- You can delete a user or multiple users.
- After a user that was authorized to manage an enterprise project is deleted, the user cannot manage the enterprise project. If the user needs to manage the enterprise project, authorize the user to manage the enterprise project again.
- Set the parameters and click Buy Now.
- On the displayed page, confirm the cluster specification order information and click Submit. The cluster creation task is submitted.
- Click Back to Cluster List to view the cluster status.
The cluster creation task takes some time. The initial status of the cluster is Creating. After the cluster is created, the cluster status changes to In service.
- Prerequisites
- Procedure