Updated on 2024-06-21 GMT+08:00

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.

ClickHouse clusters support two billing modes: pay-per-use and yearly/monthly. The pay-per-use billing mode is used by default when you create a cluster. In pay-per-use mode, compute units are charged by the duration you use them, with a billing cycle of one hour. With this mode, you can start or stop a cluster at any time and pay what you use. The yearly/monthly billing mode is recommended for long-term users to enjoy a larger discount. You can also customize a ClickHouse cluster with specified computing capabilities and storage space to meet your business needs.

Procedure

  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. Configure basic cluster information by referring to the following table.

    Figure 1 Setting parameters
    Table 1 Parameter description

    Parameter

    Description

    Region

    Current working region of the cluster.

    AZ

    Select the AZ associated with the cluster's region. For details about the AZs supported by ClickHouse, see Region and AZ.

    Billing Mode

    Select Pay-per-use or Yearly/Monthly.

    Required Duration

    This option is available only when Billing Mode is set to Yearly/Monthly. Configure this parameter based on your service requirements.

    Auto-renew

    If you select Auto-renew when creating a cluster, the system will automatically renew your subscription before it expires.

    Figure 2 Configuring cluster networks
    Table 2 Cluster and network configuration

    Parameter

    Description

    Name

    Name of a cluster.

    A cluster name must start with a letter and contain 4 to 32 letters, digits, and hyphens (-). It cannot contain other special characters.

    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 new 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 Security Group 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 on a single node, 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 scale-out and cannot be used in any production environments.

    NOTE:
    • A single node does not support scale-out or data migration.
    • An environment with just a single node is unsuitable for genuine production tasks or customer-facing activities.
    • Users of a single-node system 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;
    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:

    • 8U32G
    • 16U64
    • 32U128G
    • 64U256G
    • 128U512G

    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 500 GB to 10,000 GB per node.

    Nodes

    Set the number of nodes in a cluster. The value ranges from 2 to 20.

    Figure 3 ZooKeeper node configuration
    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

    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.

    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. For details, see Enterprise Management User Guide.
    Figure 4 Setting passwords

  5. Set the parameters and click Buy Now.
  6. On the displayed page, confirm the cluster specification order information and click Submit. The cluster creation task is submitted.
  7. 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.

  8. Submit the creation task of a yearly/monthly cluster.

    Click Pay. On the displayed purchase page, confirm the information, select a proper payment method, and confirm the payment.

    Return to the console and check the cluster status. Cluster creation takes some time. The initial status of the cluster is Creating. After the cluster is created, the cluster status changes to In service.