forked from featbit/featbit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹 refactor: enhance clickhouse cluster support (featbit#500)
* feat: enhence clickhouse cluster support * feat: 3 brokers kafka cluster in docker * update requirements.txt * kafka user and pass --------- Co-authored-by: deleteLater <[email protected]>
- Loading branch information
1 parent
c1f7d75
commit 29446fd
Showing
35 changed files
with
1,059 additions
and
31 deletions.
There are no files selected for viewing
406 changes: 406 additions & 0 deletions
406
docker/composes/docker-compose-pro-kafka-3-brokers-clickhouse-3-shards.yml
Large diffs are not rendered by default.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
infra/clickhouse/shards/clickhouse-blue-1/docker_related_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<clickhouse> | ||
<!-- Listen wildcard address to allow accepting connections from other containers and host network. --> | ||
<listen_host>::</listen_host> | ||
<listen_host>0.0.0.0</listen_host> | ||
<listen_try>1</listen_try> | ||
<max_concurrent_queries>1000</max_concurrent_queries> | ||
<!-- | ||
<logger> | ||
<console>1</console> | ||
</logger> | ||
--> | ||
|
||
<!-- Kafka --> | ||
<kafka> | ||
<security_protocol>sasl_plaintext</security_protocol> | ||
<sasl_username>kafka</sasl_username> | ||
<sasl_password>bitnami</sasl_password> | ||
<sasl_mechanisms>PLAIN</sasl_mechanisms> | ||
</kafka> | ||
|
||
</clickhouse> |
32 changes: 32 additions & 0 deletions
32
infra/clickhouse/shards/clickhouse-blue-1/enable_keeper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<clickhouse> | ||
<keeper_server> | ||
<tcp_port>9181</tcp_port> | ||
<server_id>1</server_id> | ||
<log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path> | ||
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path> | ||
|
||
<coordination_settings> | ||
<operation_timeout_ms>10000</operation_timeout_ms> | ||
<session_timeout_ms>30000</session_timeout_ms> | ||
<raft_logs_level>trace</raft_logs_level> | ||
</coordination_settings> | ||
|
||
<raft_configuration> | ||
<server> | ||
<id>1</id> | ||
<hostname>clickhouse-blue-1</hostname> | ||
<port>9234</port> | ||
</server> | ||
<server> | ||
<id>2</id> | ||
<hostname>clickhouse-blue-2</hostname> | ||
<port>9234</port> | ||
</server> | ||
<server> | ||
<id>3</id> | ||
<hostname>clickhouse-green-1</hostname> | ||
<port>9234</port> | ||
</server> | ||
</raft_configuration> | ||
</keeper_server> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<clickhouse> | ||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
<macros> | ||
<cluster>events</cluster> | ||
<shard>blue</shard> | ||
<replica>r1</replica> | ||
</macros> | ||
</clickhouse> |
39 changes: 39 additions & 0 deletions
39
infra/clickhouse/shards/clickhouse-blue-1/remote_servers.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<clickhouse> | ||
<remote_servers> | ||
<featbit_ch_cluster> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-blue-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-blue-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-green-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-green-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-orange-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-orange-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
</featbit_ch_cluster> | ||
</remote_servers> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<clickhouse> | ||
<zookeeper> | ||
<node index="1"> | ||
<host>clickhouse-blue-1</host> | ||
<port>9181</port> | ||
</node> | ||
<node index="2"> | ||
<host>clickhouse-blue-2</host> | ||
<port>9181</port> | ||
</node> | ||
<node index="3"> | ||
<host>clickhouse-green-1</host> | ||
<port>9181</port> | ||
</node> | ||
</zookeeper> | ||
</clickhouse> |
21 changes: 21 additions & 0 deletions
21
infra/clickhouse/shards/clickhouse-blue-2/docker_related_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<clickhouse> | ||
<!-- Listen wildcard address to allow accepting connections from other containers and host network. --> | ||
<listen_host>::</listen_host> | ||
<listen_host>0.0.0.0</listen_host> | ||
<listen_try>1</listen_try> | ||
<max_concurrent_queries>1000</max_concurrent_queries> | ||
<!-- | ||
<logger> | ||
<console>1</console> | ||
</logger> | ||
--> | ||
|
||
<!-- Kafka --> | ||
<kafka> | ||
<security_protocol>sasl_plaintext</security_protocol> | ||
<sasl_username>kafka</sasl_username> | ||
<sasl_password>bitnami</sasl_password> | ||
<sasl_mechanisms>PLAIN</sasl_mechanisms> | ||
</kafka> | ||
|
||
</clickhouse> |
32 changes: 32 additions & 0 deletions
32
infra/clickhouse/shards/clickhouse-blue-2/enable_keeper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<clickhouse> | ||
<keeper_server> | ||
<tcp_port>9181</tcp_port> | ||
<server_id>2</server_id> | ||
<log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path> | ||
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path> | ||
|
||
<coordination_settings> | ||
<operation_timeout_ms>10000</operation_timeout_ms> | ||
<session_timeout_ms>30000</session_timeout_ms> | ||
<raft_logs_level>trace</raft_logs_level> | ||
</coordination_settings> | ||
|
||
<raft_configuration> | ||
<server> | ||
<id>1</id> | ||
<hostname>clickhouse-blue-1</hostname> | ||
<port>9234</port> | ||
</server> | ||
<server> | ||
<id>2</id> | ||
<hostname>clickhouse-blue-2</hostname> | ||
<port>9234</port> | ||
</server> | ||
<server> | ||
<id>3</id> | ||
<hostname>clickhouse-green-1</hostname> | ||
<port>9234</port> | ||
</server> | ||
</raft_configuration> | ||
</keeper_server> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<clickhouse> | ||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
<macros> | ||
<cluster>events</cluster> | ||
<shard>blue</shard> | ||
<replica>r2</replica> | ||
</macros> | ||
</clickhouse> |
39 changes: 39 additions & 0 deletions
39
infra/clickhouse/shards/clickhouse-blue-2/remote_servers.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<clickhouse> | ||
<remote_servers> | ||
<featbit_ch_cluster> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-blue-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-blue-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-green-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-green-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-orange-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-orange-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
</featbit_ch_cluster> | ||
</remote_servers> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<clickhouse> | ||
<zookeeper> | ||
<node index="1"> | ||
<host>clickhouse-blue-1</host> | ||
<port>9181</port> | ||
</node> | ||
<node index="2"> | ||
<host>clickhouse-blue-2</host> | ||
<port>9181</port> | ||
</node> | ||
<node index="3"> | ||
<host>clickhouse-green-1</host> | ||
<port>9181</port> | ||
</node> | ||
</zookeeper> | ||
</clickhouse> |
21 changes: 21 additions & 0 deletions
21
infra/clickhouse/shards/clickhouse-green-1/docker_related_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<clickhouse> | ||
<!-- Listen wildcard address to allow accepting connections from other containers and host network. --> | ||
<listen_host>::</listen_host> | ||
<listen_host>0.0.0.0</listen_host> | ||
<listen_try>1</listen_try> | ||
<max_concurrent_queries>1000</max_concurrent_queries> | ||
<!-- | ||
<logger> | ||
<console>1</console> | ||
</logger> | ||
--> | ||
|
||
<!-- Kafka --> | ||
<kafka> | ||
<security_protocol>sasl_plaintext</security_protocol> | ||
<sasl_username>kafka</sasl_username> | ||
<sasl_password>bitnami</sasl_password> | ||
<sasl_mechanisms>PLAIN</sasl_mechanisms> | ||
</kafka> | ||
|
||
</clickhouse> |
32 changes: 32 additions & 0 deletions
32
infra/clickhouse/shards/clickhouse-green-1/enable_keeper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<clickhouse> | ||
<keeper_server> | ||
<tcp_port>9181</tcp_port> | ||
<server_id>3</server_id> | ||
<log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path> | ||
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path> | ||
|
||
<coordination_settings> | ||
<operation_timeout_ms>10000</operation_timeout_ms> | ||
<session_timeout_ms>30000</session_timeout_ms> | ||
<raft_logs_level>trace</raft_logs_level> | ||
</coordination_settings> | ||
|
||
<raft_configuration> | ||
<server> | ||
<id>1</id> | ||
<hostname>clickhouse-blue-1</hostname> | ||
<port>9234</port> | ||
</server> | ||
<server> | ||
<id>2</id> | ||
<hostname>clickhouse-blue-2</hostname> | ||
<port>9234</port> | ||
</server> | ||
<server> | ||
<id>3</id> | ||
<hostname>clickhouse-green-1</hostname> | ||
<port>9234</port> | ||
</server> | ||
</raft_configuration> | ||
</keeper_server> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<clickhouse> | ||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
<macros> | ||
<cluster>events</cluster> | ||
<shard>green</shard> | ||
<replica>r1</replica> | ||
</macros> | ||
</clickhouse> |
39 changes: 39 additions & 0 deletions
39
infra/clickhouse/shards/clickhouse-green-1/remote_servers.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<clickhouse> | ||
<remote_servers> | ||
<featbit_ch_cluster> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-blue-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-blue-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-green-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-green-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse-orange-1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse-orange-2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
</featbit_ch_cluster> | ||
</remote_servers> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<clickhouse> | ||
<zookeeper> | ||
<node index="1"> | ||
<host>clickhouse-blue-1</host> | ||
<port>9181</port> | ||
</node> | ||
<node index="2"> | ||
<host>clickhouse-blue-2</host> | ||
<port>9181</port> | ||
</node> | ||
<node index="3"> | ||
<host>clickhouse-green-1</host> | ||
<port>9181</port> | ||
</node> | ||
</zookeeper> | ||
</clickhouse> |
21 changes: 21 additions & 0 deletions
21
infra/clickhouse/shards/clickhouse-green-2/docker_related_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<clickhouse> | ||
<!-- Listen wildcard address to allow accepting connections from other containers and host network. --> | ||
<listen_host>::</listen_host> | ||
<listen_host>0.0.0.0</listen_host> | ||
<listen_try>1</listen_try> | ||
<max_concurrent_queries>1000</max_concurrent_queries> | ||
<!-- | ||
<logger> | ||
<console>1</console> | ||
</logger> | ||
--> | ||
|
||
<!-- Kafka --> | ||
<kafka> | ||
<security_protocol>sasl_plaintext</security_protocol> | ||
<sasl_username>kafka</sasl_username> | ||
<sasl_password>bitnami</sasl_password> | ||
<sasl_mechanisms>PLAIN</sasl_mechanisms> | ||
</kafka> | ||
|
||
</clickhouse> |
Oops, something went wrong.