From 36377a28f868910256eed3a5e911acbf9488e80b Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:48:32 +0100 Subject: [PATCH 1/7] adding documentation following shard support --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index fe1b42e..f90f782 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,30 @@ For debugging purposes it is better to start just with one host and then add mor **clickhouse_path**: Path to the directory where ClickHouse will store data **clickhouse_log_directory**: Path to the error and normal logs. + +**clickhouse_clusters**: is the list of clusters and also contains the shards that are part of each cluster. + + clickhouse_clusters: + distributed_cluster_1: + shard1: + - { host: "host_1", port: 9000 } + - { host: "host_2", port: 9000 } + shard2: + - { host: "host_3", port: 9000 } + - { host: "host_4", port: 9000 } + distributed_cluster_2: + shard1: + - { host: "host_5", port: 9000 } + - { host: "host_6", port: 9000 } + shard2: + - { host: "host_7", port: 9000 } + - { host: "host_8", port: 9000 } + + +**cluster**: is the cluster name which is used for replication in the macros.xml file. +**distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters** +**shard**: is the shard number (01, 02) that being part of the replication inside one shard + ## Dependencies None. From d5a13d3492c5f352c2fd2203b096b13643b0ebb4 Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:49:16 +0100 Subject: [PATCH 2/7] adding documentation following shard support --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f90f782..c909bb3 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,9 @@ For debugging purposes it is better to start just with one host and then add mor **cluster**: is the cluster name which is used for replication in the macros.xml file. + **distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters** + **shard**: is the shard number (01, 02) that being part of the replication inside one shard ## Dependencies From e8cdaf7f1a1dcb097a860c69921695c4a509e753 Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:50:47 +0100 Subject: [PATCH 3/7] adding documentation following shard support --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c909bb3..9f93cc3 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,6 @@ For debugging purposes it is better to start just with one host and then add mor **clickhouse_zookeeper_credentials** in format ``username:password`` is used to authenticate against Zookeeper. **clickhouse_path**: Path to the directory where ClickHouse will store data **clickhouse_log_directory**: Path to the error and normal logs. - - **clickhouse_clusters**: is the list of clusters and also contains the shards that are part of each cluster. clickhouse_clusters: @@ -91,12 +89,9 @@ For debugging purposes it is better to start just with one host and then add mor - { host: "host_7", port: 9000 } - { host: "host_8", port: 9000 } - **cluster**: is the cluster name which is used for replication in the macros.xml file. - -**distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters** - -**shard**: is the shard number (01, 02) that being part of the replication inside one shard +**distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters**. +**shard**: is the shard number (01, 02) that being part of the replication inside one shard. ## Dependencies From 2de9973df9f8e5b111dcf758625081d813f8ca94 Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:51:19 +0100 Subject: [PATCH 4/7] adding documentation following shard support --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9f93cc3..28b0476 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ Quota [settings](https://clickhouse.tech/docs/en/operations/settings/settings-pr For debugging purposes it is better to start just with one host and then add more hosts. **clickhouse_zookeeper_credentials** in format ``username:password`` is used to authenticate against Zookeeper. + **clickhouse_path**: Path to the directory where ClickHouse will store data **clickhouse_log_directory**: Path to the error and normal logs. **clickhouse_clusters**: is the list of clusters and also contains the shards that are part of each cluster. From 781099c242c3b140455db17d7e0f6f8db07c825c Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:53:12 +0100 Subject: [PATCH 5/7] adding documentation following shard support --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 28b0476..0770452 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Server configuration directory. Server log level. - clickhouse_profiles: + clickhouse_profiles: default: max_memory_usage: 10000000000 use_uncompressed_cache: 0 @@ -28,7 +28,7 @@ Server log level. A settings profile is a collection of [settings](https://clickhouse.tech/docs/en/operations/settings/settings-profiles/) grouped under the same name. - clickhouse_profiles: + clickhouse_profiles: default: password: "qwerty" profile: "default" @@ -36,7 +36,7 @@ A settings profile is a collection of [settings](https://clickhouse.tech/docs/en The `users` section of the `user.xml` configuration file contains user [settings](https://clickhouse.tech/docs/en/operations/settings/settings-users/). - clickhouse_profiles: + clickhouse_profiles: default: intervals: - duration: 3600 @@ -48,14 +48,14 @@ The `users` section of the `user.xml` configuration file contains user [setting Quota [settings](https://clickhouse.tech/docs/en/operations/settings/settings-profiles/) is for limiting resource usage over a period of time or track the use of resources. - clickhouse_databases: + clickhouse_databases: - these_metrics - other_metrics - imported_data **clickhouse_databases** is a list of the databases you want to create in ClickHouse. - clickhouse_zookeeper_hosts: + clickhouse_zookeeper_hosts: - 1.2.3.4 - 1.2.3.5 @@ -71,7 +71,9 @@ For debugging purposes it is better to start just with one host and then add mor **clickhouse_zookeeper_credentials** in format ``username:password`` is used to authenticate against Zookeeper. **clickhouse_path**: Path to the directory where ClickHouse will store data + **clickhouse_log_directory**: Path to the error and normal logs. + **clickhouse_clusters**: is the list of clusters and also contains the shards that are part of each cluster. clickhouse_clusters: @@ -91,7 +93,9 @@ For debugging purposes it is better to start just with one host and then add mor - { host: "host_8", port: 9000 } **cluster**: is the cluster name which is used for replication in the macros.xml file. + **distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters**. + **shard**: is the shard number (01, 02) that being part of the replication inside one shard. ## Dependencies From 3867452e9f25ae1cd45472738d41849ec0a2723d Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:58:20 +0100 Subject: [PATCH 6/7] adapt variable name --- README.md | 8 +++++--- templates/macros.xml.j2 | 6 +++--- vars/main.yml | 3 +++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0770452..72cbe32 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,13 @@ For debugging purposes it is better to start just with one host and then add mor - { host: "host_7", port: 9000 } - { host: "host_8", port: 9000 } -**cluster**: is the cluster name which is used for replication in the macros.xml file. +For the file macros.xml, you need to fill the variables below: -**distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters**. +**clickhouse_cluster**: is the cluster name which is used for replication. -**shard**: is the shard number (01, 02) that being part of the replication inside one shard. +**clickhouse_distributed_cluster**: is the distributed cluster name defined in **clickhouse_clusters**. + +**clickhouse_shard**: is the shard number (01, 02) that being part of the replication inside one shard. ## Dependencies diff --git a/templates/macros.xml.j2 b/templates/macros.xml.j2 index c96360d..34e71d1 100644 --- a/templates/macros.xml.j2 +++ b/templates/macros.xml.j2 @@ -2,9 +2,9 @@ - {{ cluster }} - {{ shard }} + {{ clickhouse_cluster }} + {{ clickhouse_shard }} {{ inventory_hostname }} - {{ distributed_cluster }} + {{ clickouse_distributed_cluster }} diff --git a/vars/main.yml b/vars/main.yml index 7e06810..52d8124 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,6 @@ --- clickhouse_group: clickhouse clickhouse_user: clickhouse +clickhouse_shard: 01 +clickouse_cluster: clickhouse-cluster +clickouse_distributed_cluster: distributed_cluster From f167f63a55e0167c96428bb93fa67d34ff427c28 Mon Sep 17 00:00:00 2001 From: stephanepham-sib Date: Wed, 17 Feb 2021 14:59:43 +0100 Subject: [PATCH 7/7] adapt variable name --- templates/macros.xml.j2 | 2 +- vars/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/macros.xml.j2 b/templates/macros.xml.j2 index 34e71d1..7f63850 100644 --- a/templates/macros.xml.j2 +++ b/templates/macros.xml.j2 @@ -5,6 +5,6 @@ {{ clickhouse_cluster }} {{ clickhouse_shard }} {{ inventory_hostname }} - {{ clickouse_distributed_cluster }} + {{ clickhouse_distributed_cluster }} diff --git a/vars/main.yml b/vars/main.yml index 52d8124..268122c 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -2,5 +2,5 @@ clickhouse_group: clickhouse clickhouse_user: clickhouse clickhouse_shard: 01 -clickouse_cluster: clickhouse-cluster -clickouse_distributed_cluster: distributed_cluster +clickhouse_cluster: clickhouse-cluster +clickhouse_distributed_cluster: distributed_cluster