Closed Ri0nGo closed 3 months ago
Hi @Ri0nGo
The client does not implement a failover mechanism for a broken nodes. (This can be implemented as an additional feature.)
I think about two approaches you can take to make it work as you expect:
DialStrategy logic
. It's a undocumented feature. Explanation in a PR: https://github.com/ClickHouse/clickhouse-go/pull/855I would go with the first option as the most robust and resilient solution.
Observed
I have built a clickhouse cluster with 2 nodes, using http protocol to connect to the cluster, when I stop a node, querying the data will report an error.
detail descption:
Expected behaviour
It is possible to switch to the normal clickhouse node
Code example
Error log
Details
Environment
[x]
clickhouse-go
: github.com/ClickHouse/clickhouse-go/v2 v2.26.0[x] Interface:
database/sql
[x] Go version: go1.21.6 windows/amd64
[x] Operating system: Windows11 23H2
[x] ClickHouse version: 24.3.2.23
[x] Is it a ClickHouse Cloud? no, build clickhouse cluster in local
[x] ClickHouse Server non-default settings, if any: use defualt setting
[x]
CREATE TABLE
statements for tables involved:[ ] Sample data for all these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary