This Docker Compose setup runs ClickHouse database server with CHProxy as a connection proxy.
- ClickHouse: Database server running on ports 8123 (HTTP) and 9000 (Native)
- CHProxy: HTTP proxy for ClickHouse running on port 9090
-
Start the services:
docker-compose -f clickhouse.docker-compose.yaml up -d
-
Check service health:
docker-compose -f clickhouse.docker-compose.yaml ps
-
Test ClickHouse directly:
curl "http://localhost:8123/ping" -
Test CHProxy:
curl "http://localhost:9090/ping" -
Run a test query through CHProxy:
curl "http://localhost:9090/?query=SELECT version()"
chproxy-config.yml: CHProxy configuration with connection pooling and rate limitingclickhouse-config/config.xml: ClickHouse server configuration- Persistent data is stored in Docker volumes (
clickhouse_dataandclickhouse_logs)
- 8123: ClickHouse HTTP interface (direct access)
- 9000: ClickHouse Native TCP interface
- 9090: CHProxy HTTP interface (recommended for applications)
- Connection pooling: Reduces connection overhead
- Rate limiting: Prevents query abuse
- Load balancing: Can distribute queries across multiple ClickHouse instances
- Security: Additional authentication and authorization layer
- Caching: Optional query result caching
docker-compose -f clickhouse.docker-compose.yaml downTo remove volumes as well:
docker-compose -f clickhouse.docker-compose.yaml down -v