-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding experimental replicated function to clickhouse #40
- Loading branch information
Showing
33 changed files
with
279 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
|
@@ -3,3 +3,7 @@ services: | |
ports: | ||
- 9000:9000 | ||
- 8123:8123 | ||
clickhouse-r-1: | ||
ports: | ||
- 19000:9000 | ||
- 18123:8123 |
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
15 changes: 15 additions & 0 deletions
15
docker/volume/clickhouse-cluster-replicated/config/clickhouse1/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,15 @@ | ||
<clickhouse> | ||
<logger> | ||
<level>error</level> | ||
<console>1</console> | ||
<size>10M</size> | ||
<count>3</count> | ||
</logger> | ||
<listen_host>0.0.0.0</listen_host> | ||
<http_port>8123</http_port> | ||
<tcp_port>9000</tcp_port> | ||
|
||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
</clickhouse> |
10 changes: 10 additions & 0 deletions
10
docker/volume/clickhouse-cluster-replicated/config/clickhouse1/macros.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,10 @@ | ||
<clickhouse> | ||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
<macros> | ||
<shard>01</shard> | ||
<replica>clickhouse1</replica> | ||
<cluster>test_cluster</cluster> | ||
</macros> | ||
</clickhouse> |
17 changes: 17 additions & 0 deletions
17
docker/volume/clickhouse-cluster-replicated/config/clickhouse1/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,17 @@ | ||
<clickhouse> | ||
<remote_servers> | ||
<test_cluster> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
</test_cluster> | ||
</remote_servers> | ||
</clickhouse> |
8 changes: 8 additions & 0 deletions
8
docker/volume/clickhouse-cluster-replicated/config/clickhouse1/use_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,8 @@ | ||
<clickhouse> | ||
<zookeeper> | ||
<node> | ||
<host>clickhouse-keeper</host> | ||
<port>9181</port> | ||
</node> | ||
</zookeeper> | ||
</clickhouse> |
8 changes: 8 additions & 0 deletions
8
docker/volume/clickhouse-cluster-replicated/config/clickhouse1/users.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,8 @@ | ||
<clickhouse> | ||
<profiles> | ||
<default> | ||
<allow_experimental_database_replicated>1</allow_experimental_database_replicated> | ||
<distributed_ddl_output_mode>null_status_on_timeout</distributed_ddl_output_mode> | ||
</default> | ||
</profiles> | ||
</clickhouse> |
15 changes: 15 additions & 0 deletions
15
docker/volume/clickhouse-cluster-replicated/config/clickhouse2/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,15 @@ | ||
<clickhouse> | ||
<logger> | ||
<level>error</level> | ||
<console>1</console> | ||
<size>10M</size> | ||
<count>3</count> | ||
</logger> | ||
<listen_host>0.0.0.0</listen_host> | ||
<http_port>8123</http_port> | ||
<tcp_port>9000</tcp_port> | ||
|
||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
</clickhouse> |
10 changes: 10 additions & 0 deletions
10
docker/volume/clickhouse-cluster-replicated/config/clickhouse2/macros.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,10 @@ | ||
<clickhouse> | ||
<distributed_ddl> | ||
<path>/clickhouse/task_queue/ddl</path> | ||
</distributed_ddl> | ||
<macros> | ||
<shard>01</shard> | ||
<replica>clickhouse2</replica> | ||
<cluster>test_cluster</cluster> | ||
</macros> | ||
</clickhouse> |
17 changes: 17 additions & 0 deletions
17
docker/volume/clickhouse-cluster-replicated/config/clickhouse2/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,17 @@ | ||
<clickhouse> | ||
<remote_servers> | ||
<test_cluster> | ||
<shard> | ||
<internal_replication>true</internal_replication> | ||
<replica> | ||
<host>clickhouse1</host> | ||
<port>9000</port> | ||
</replica> | ||
<replica> | ||
<host>clickhouse2</host> | ||
<port>9000</port> | ||
</replica> | ||
</shard> | ||
</test_cluster> | ||
</remote_servers> | ||
</clickhouse> |
8 changes: 8 additions & 0 deletions
8
docker/volume/clickhouse-cluster-replicated/config/clickhouse2/use_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,8 @@ | ||
<clickhouse> | ||
<zookeeper> | ||
<node> | ||
<host>clickhouse-keeper</host> | ||
<port>9181</port> | ||
</node> | ||
</zookeeper> | ||
</clickhouse> |
8 changes: 8 additions & 0 deletions
8
docker/volume/clickhouse-cluster-replicated/config/clickhouse2/users.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,8 @@ | ||
<clickhouse> | ||
<profiles> | ||
<default> | ||
<allow_experimental_database_replicated>1</allow_experimental_database_replicated> | ||
<distributed_ddl_output_mode>null_status_on_timeout</distributed_ddl_output_mode> | ||
</default> | ||
</profiles> | ||
</clickhouse> |
28 changes: 28 additions & 0 deletions
28
docker/volume/clickhouse-cluster-replicated/config/keeper1/keeper_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,28 @@ | ||
<clickhouse replace="true"> | ||
<logger> | ||
<level>information</level> | ||
<log>/var/log/clickhouse-keeper/clickhouse-keeper.log</log> | ||
<errorlog>/var/log/clickhouse-keeper/clickhouse-keeper.err.log</errorlog> | ||
<size>1000M</size> | ||
<count>3</count> | ||
</logger> | ||
<listen_host>0.0.0.0</listen_host> | ||
<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>information</raft_logs_level> | ||
</coordination_settings> | ||
<raft_configuration> | ||
<server> | ||
<id>1</id> | ||
<hostname>clickhouse-keeper</hostname> | ||
<port>9234</port> | ||
</server> | ||
</raft_configuration> | ||
</keeper_server> | ||
</clickhouse> |
7 changes: 3 additions & 4 deletions
7
docker/volume/clickhouse-cluster/config/clickhouse1/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
7 changes: 3 additions & 4 deletions
7
docker/volume/clickhouse-cluster/config/clickhouse2/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
7 changes: 4 additions & 3 deletions
7
fixtures/clickhouse_cluster/200905_192800_create_test_table.up.sql
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
2 changes: 1 addition & 1 deletion
2
fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.down.sql
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
ALTER TABLE test ON CLUSTER test_cluster | ||
ALTER TABLE raw.test ON CLUSTER test_cluster | ||
DROP COLUMN text; | ||
|
4 changes: 2 additions & 2 deletions
4
fixtures/clickhouse_cluster/200922_210000_add_column_to_test_table.up.sql
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ALTER TABLE test ON CLUSTER test_cluster | ||
ALTER TABLE raw.test ON CLUSTER test_cluster | ||
ADD COLUMN text String; | ||
|
||
INSERT INTO test (value, text) VALUES (1, 'Hello'); | ||
INSERT INTO raw.test (value, text) VALUES (1, 'Hello'); |
2 changes: 1 addition & 1 deletion
2
fixtures/clickhouse_cluster/210327_230201_broken_migration.safe.up.sql
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 |
---|---|---|
@@ -1 +1 @@ | ||
INSERT INTO test2 (time) VALUES (now()); | ||
INSERT INTO raw.test2 (time) VALUES (now()); |
1 change: 1 addition & 0 deletions
1
fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.down.sql
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 @@ | ||
DROP TABLE raw.test NO DELAY; |
13 changes: 13 additions & 0 deletions
13
fixtures/clickhouse_cluster_replicated/200905_192800_create_test_table.up.sql
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,13 @@ | ||
CREATE DATABASE IF NOT EXISTS raw | ||
ENGINE = Replicated('/clickhouse/databases/{shard}/raw', '{shard}', '{replica}'); | ||
|
||
CREATE TABLE IF NOT EXISTS raw.test ( | ||
time DateTime DEFAULT now(), | ||
value UInt32 | ||
) | ||
ENGINE = ReplicatedMergeTree ( | ||
'/clickhouse/tables/{shard}/raw_test_cluster_test', | ||
'{replica}' | ||
) | ||
PARTITION BY toYYYYMM(time) | ||
ORDER BY (time, value); |
1 change: 1 addition & 0 deletions
1
fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.down.sql
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 @@ | ||
ALTER TABLE raw.test DROP COLUMN text; |
3 changes: 3 additions & 0 deletions
3
fixtures/clickhouse_cluster_replicated/200922_210000_add_column_to_test_table.up.sql
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,3 @@ | ||
ALTER TABLE raw.test ADD COLUMN text String; | ||
|
||
INSERT INTO raw.test (value, text) VALUES (1, 'Hello'); |
Empty file.
1 change: 1 addition & 0 deletions
1
fixtures/clickhouse_cluster_replicated/210327_230201_broken_migration.safe.up.sql
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 @@ | ||
INSERT INTO raw.test2 (time) VALUES (now()); |
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
Oops, something went wrong.