Deploying ClickHouse
Hardware and Software Requirements
Hardware Requirements
- CPU. ClickHouse performs more efficiently in configurations with a larger number of cores at a lower clock speed than in configurations with fewer cores and a higher clock speed.
- RAM. Minimum 16 GB of RAM, 64 GB or more is recommended for processing large volumes of data.
- Disk Space. SSDs are recommended for data storage.
- Network Requirements. A high-speed network connection is required to ensure fast data transfer between nodes.
Software Requirements
- Operating System. Installation can be performed on any Linux distribution.
- Dependencies. The following libraries and packages are required to install ClickHouse:
libicu
,libzstd
,liblz4
,libxxhash
.
Installation from TGZ Archive
The required version can be downloaded using curl or wget from the repository:
https://packages.clickhouse.com/tgz/
After that, the downloaded archives should be unpacked and installed using the installation scripts.
Steps to Download and Install the Latest Stable Version of ClickHouse
It is recommended to use the latest stable version of ClickHouse. For correct installation, set variables defining the architecture and version of ClickHouse:
export ARCH=<architecture>
export VERSION=<stable_version>
<stable_version>
- the stable version of ClickHouse<architecture>
- the architecture of the target system, possible values areamd64
orarm64
The VERSION
variable can be omitted, in which case the script will automatically use the latest available version.
Execute the script to download the ClickHouse distribution. The archive will be saved in the current directory.
if [ -z "$VERSION" ]; then
export VERSION=$(curl -s https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/utils/list-versions/version_date.tsv | \
grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1)
fi
for PKG in clickhouse-common-static clickhouse-common-static-dbg clickhouse-server clickhouse-client
do
curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$VERSION-${ARCH}.tgz" \
|| curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$VERSION.tgz"
done
Installation on the Target Host
For correct installation on the target host, set the variables that were used in the previous step:
export ARCH=<architecture>
export VERSION=<stable_version>
The commands below perform the installation of the main ClickHouse components from the tgz archives downloaded earlier.
tar -xzvf "clickhouse-common-static-$VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-common-static-$VERSION.tgz"
sudo "clickhouse-common-static-$VERSION/install/doinst.sh"
tar -xzvf "clickhouse-common-static-dbg-$VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-common-static-dbg-$VERSION.tgz"
sudo "clickhouse-common-static-dbg-$VERSION/install/doinst.sh"
tar -xzvf "clickhouse-server-$VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-server-$VERSION.tgz"
sudo "clickhouse-server-$VERSION/install/doinst.sh" configure
sudo systemctl start clickhouse-server
tar -xzvf "clickhouse-client-$VERSION-${ARCH}.tgz" \
|| tar -xzvf "clickhouse-client-$VERSION.tgz"
sudo "clickhouse-client-$VERSION/install/doinst.sh"
During the installation, you will be prompted to enter a password for the default user - default
, which is saved in /etc/clickhouse-server/users.d/default-password.xml
and can be changed later.
It is also necessary to allow network connections. This parameter affects the ability of clients to connect to the ClickHouse server from external networks.