feat: allow configuring clusterMode#1273
Conversation
|
@absorbb this would help our setup, or do you have some alternative ideas? |
| ClickHouseProtocolHTTPS ClickHouseProtocol = "https" | ||
| ) | ||
|
|
||
| type ClickHouseClusterMode string |
There was a problem hiding this comment.
It would be more universal to change this parameter to ClickHouseDatabaseEngine
with possible values:
default - Atomic or Shared (for Clickhouse Cloud)
replicated - Replicated
|
|
||
| // InitDatabase create database instance if doesn't exist | ||
| func (ch *ClickHouse) InitDatabase(ctx context.Context) error { | ||
| err := ch.createDatabaseIfNotExists(ctx, ch.config.Database) |
There was a problem hiding this comment.
If replicated engine is selected in config - we need to respect this setting when creating a new DB if one doesn't exist
|
@KadekM |
|
Thanks, I'll look into it! |
Destination currently always emits
ENGINE = Replicated*MergeTree('/clickhouse/tables/{shard}/<db>/<table>', '{replica}')when cluster is set.That works for classic multi-node ClickHouse, but it's rejected by the server when the target database itself uses
ENGINE=Replicated(...)and in that mode ClickHouse manages the ZooKeeper path and replica macros automatically and refuses explicit arguments.