Install ClickHouse on rpm-based distributions
It is recommended to use official pre-compiled
rpmpackages for CentOS, RedHat, and all other rpm-based Linux distributions.
Review recommendations
Before installing ClickHouse, review the following recommendations:
- Swap: Disable the operating system's swap file in production environments.
- Disk space: The ClickHouse binary requires at least 2.5 GB of disk space for installation.
- Network: For distributed deployments (clustering), use at least 10 Gbit network connectivity. Network bandwidth is critical for processing distributed queries with large amounts of intermediate data, as well as for replication.
Estimating storage requirements
To estimate the disk space needed for your data:
- Estimate data volume: Take a sample of your data and calculate the average row size, then multiply by the number of rows you plan to store.
- Apply the compression coefficient: Load a sample into ClickHouse and compare the original data size with the stored table size. Clickstream data, for example, is typically compressed 6-10x.
- Account for replicas: If you plan to store data in multiple replicas, multiply the estimated volume by the number of replicas.
For more detailed hardware requirements, see "Sizing and hardware recommendations"
Set up the RPM repository
Add the official repository by running the following command:
For systems with zypper package manager (openSUSE, SLES), run:
In the steps below, yum install can be replaced by zypper install, depending
on which package manager you're using.
Install ClickHouse server and client
To install ClickHouse run the following commands:
- You can replace
stablewithltsto use different release kinds based on your needs. - You can download and install packages manually from packages.clickhouse.com/rpm.
- To specify a particular version, add
-$versionto the end of the package name, for example:
Start ClickHouse server
To start ClickHouse server, run:
To start ClickHouse client, run:
If you set up a password for your server, then you will need to run:
Install standalone ClickHouse Keeper
In production environments we strongly recommend running ClickHouse Keeper on dedicated nodes. In test environments, if you decide to run ClickHouse Server and ClickHouse Keeper on the same server, then you don't need to install ClickHouse Keeper as it is included with ClickHouse server.
To install clickhouse-keeper on standalone ClickHouse Keeper servers, run: