This repository provides a simple example of how to deploy a ClickHouse cluster with ClickHouse Keeper using Docker Compose. The cluster consists of two shards and two replicas.
-
Ensure Docker is installed and running on your system.
-
Clone this repository to your local machine.
-
Open a terminal window and navigate to the project directory.
To start the cluster, run the following command:
make up
This will start the ClickHouse server and keeper containers.
The containers will be named clickhouse-<shard-id>-<replica-id>
and clickhouse-keeper-<id>
.
Optionally, you can start Grafana by running the following command:
make up-with-grafana
This will start the ClickHouse server, keeper, and Grafana containers. The Grafana will be available at http://localhost:3000
.
To access the ClickHouse client, you can run the following command:
make client
This will open a bash terminal in the container for the first ClickHouse server (clickhouse-01-01
), allowing you to execute SQL queries against the cluster.
To stop the cluster, run the following command:
make down