1. Network Planning
Before setting up the ClickHouse cluster, we need to properly plan the network environment. Our cluster will consist of three nodes, and each node requires configuration of IP address, hostname, firewall settings, and time synchronization.
- Node 1: node01, IP address: 10.30.201.21, hostname: node01, firewall disabled, time synchronization via NTP server.
- Node 2: node02, IP address: 10.30.201.22, hostname: node02, firewall disabled, time synchronization via NTP server.
- Node 3: node03, IP address: 10.30.201.23, hostname: node03, firewall disabled, time synchronization via NTP server.
2. Hardware Configuration
Our cluster will use three machines, each with the following configuration:
- Node 1: 16 cores, 32GB RAM, 300GB disk, 1GbE network card.
- Node 2: 16 cores, 32GB RAM, 300GB disk, 1GbE network card.
- Node 3: 16 cores, 32GB RAM, 300GB disk, 1GbE network card.
3. Software Installation and Configuration
The following software will be installed on the cluster:
- CentOS 7.6 virtual machines.
- JDK 1.8.
- ZooKeeper 3.4.6.
- ClickHouse 20.8.3.18.
We will install CentOS 7.6, followed by JDK 1.8. Then we will install ZooKeeper 3.4.6 and ClickHouse 20.8.3.18.
4. ClickHouse Cluster Configuration
After installing all required software, we will configure the ClickHouse cluster. This will include disk management with LVM, node configuration, setting up hosts mapping, disabling the firewall, configuring passwordless SSH login, and setting up time synchronization. The cluster will consist of three nodes, each with the following configuration:
- Node 1: node01, IP address: 10.30.201.21, hostname: node01, firewall disabled, time synchronization via NTP server.
- Node 2: node02, IP address: 10.30.201.22, hostname: node02, firewall disabled, time synchronization via NTP server.
- Node 3: node03, IP address: 10.30.201.23, hostname: node03, firewall disabled, time synchronization via NTP server.