I am trying to create a ClickHouse cluster with 1 Shard and 3 Replias. My deployment requires some bootstrap script to be run on the first start (create a database in advanced).
This is the content of my 00_default_overrides.xml file
clickhouse 04:18:43.18 INFO ==> ** Starting ClickHouse setup **
clickhouse 04:18:43.21 INFO ==> Copying mounted configuration from /bitnami/clickhouse/etc
cp: -r not specified; omitting directory '/bitnami/clickhouse/etc/conf.d/default/..data'
clickhouse 04:18:43.22 INFO ==> Starting ClickHouse in background
clickhouse 04:19:43.26 INFO ==> ClickHouse started successfully
clickhouse 04:19:43.26 INFO ==> Loading user's custom files from /docker-entrypoint-initdb.d
clickhouse 04:19:43.27 WARN ==> Sourcing /docker-entrypoint-initdb.d/platform_init_script.sh as it is not executable by the current user, any error may cause initialization to fail
Received exception from server (version 24.8.4):
Code: 999. DB::Exception: Received from localhost:9000. Coordination::Exception. Coordination::Exception: All connection tries failed while connecting to ZooKeeper. nodes: 10.10.1.130:2181, 10.10.2.45:2181, 10.10.2.133:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.1.130:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.2.45:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.2.133:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.1.130:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.2.45:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.2.133:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.1.130:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.2.45:2181
Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 24.8.4.13 (official build)), 10.10.2.133:2181
. (KEEPER_EXCEPTION)
(query: CREATE DATABASE IF NOT EXISTS test ON CLUSTER default;)
Additional information
The container's logs have 2 different error messages:
cp: -r not specified; omitting directory '/bitnami/clickhouse/etc/conf.d/default/..data <- This is because the bitnami/clickhouse image did not include -r option when executing cp command.
Code: 999. DB::Exception: Received from localhost:9000 <- This is because the bitnami/clickhouse image only listen to localhost when starting in background for running custom script
I'm going to raise a PR for fixing these errors. Please review.
I've test the code changes, which works as expected
clickhouse 02:17:37.92 INFO ==> ** Starting ClickHouse setup **
clickhouse 02:17:37.95 INFO ==> Copying mounted configuration from /bitnami/clickhouse/etc
clickhouse 02:17:37.97 INFO ==> Starting ClickHouse in background
clickhouse 02:17:42.98 INFO ==> ClickHouse started successfully
clickhouse 02:17:42.98 INFO ==> Loading user's custom files from /docker-entrypoint-initdb.d
clickhouse 02:17:42.98 WARN ==> Sourcing /docker-entrypoint-initdb.d/platform_init_script.sh as it is not executable by the current user, any error may cause initialization to fail
chi-shard0-0.chi-headless.chi.svc.cluster.local 9000 0 2 0
chi-shard0-2.chi-headless.chi.svc.cluster.local 9000 0 1 0
chi-shard0-1.chi-headless.chi.svc.cluster.local 9000 0 0 0
clickhouse 02:17:59.74 INFO ==> ** ClickHouse setup finished! **
clickhouse 02:17:59.75 INFO ==> ** Starting ClickHouse **
Processing configuration file '/opt/bitnami/clickhouse/etc/config.xml'.
Merging configuration file '/opt/bitnami/clickhouse/etc/conf.d/00_default_overrides.xml'.
Merging configuration file '/opt/bitnami/clickhouse/etc/conf.d/platform_extra_overrides.xml'.
Name and Version
bitnami/clickhouse 24.8.4-debian-12-r0
What architecture are you using?
amd64
What steps will reproduce the bug?
I am trying to create a ClickHouse cluster with 1 Shard and 3 Replias. My deployment requires some bootstrap script to be run on the first start (create a database in advanced).
This is the content of my 00_default_overrides.xml file
I've created an init script to create a new database and mounted it to /docker-entrypoint-initdb.d
When apply the config and start the ClickHouse server with /script/setup.sh command, it threw some errors and my container crashed after some reboots.
Are you using any custom parameters or values?
Here is my values.yaml config:
What is the expected behavior?
What do you see instead?
Additional information
The container's logs have 2 different error messages:
I'm going to raise a PR for fixing these errors. Please review.
I've test the code changes, which works as expected