An example of running a local ClickHouse
cluster using clickhouse-keeper
for replication.
Config examples accompanying the blog post.
make gen-clickhouse-config
make up
docker-compose exec clickhouse-blue-1 clickhouse-client
Run all the commands present inside schema.sql.
SELECT * FROM
(
SELECT hostName(), *
FROM remote('172.20.0.2', 'app', 'events_local')
UNION ALL
SELECT hostName(), *
FROM remote('172.20.0.3', 'app', 'events_local')
UNION ALL
SELECT hostName(), *
FROM remote('172.20.0.4', 'app', 'events_local')
UNION ALL
SELECT hostName(), *
FROM remote('172.20.0.5', 'app', 'events_local')
UNION ALL
SELECT hostName(), *
FROM remote('172.20.0.6', 'app', 'events_local')
UNION ALL
SELECT hostName(), *
FROM remote('172.20.0.7', 'app', 'events_local')
);
Replace the private IPs with the host_address
you find inside your cluster:
SELECT
host_name,
host_address
FROM system.clusters