Skip to content

Commit

Permalink
Merge pull request #31 from nl2go/shard-support-doc
Browse files Browse the repository at this point in the history
adding documentation following shard support
  • Loading branch information
stephanepham-sib authored Feb 18, 2021
2 parents 1eb02a6 + f167f63 commit e782589
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ Server configuration directory.

Server log level.

clickhouse_profiles:
clickhouse_profiles:
default:
max_memory_usage: 10000000000
use_uncompressed_cache: 0
load_balancing: "random"

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"
quota: "default"

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
Expand All @@ -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

Expand All @@ -69,9 +69,37 @@ 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.

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 }

For the file macros.xml, you need to fill the variables below:

**clickhouse_cluster**: is the cluster name which is used for replication.

**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

None.
Expand Down
6 changes: 3 additions & 3 deletions templates/macros.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- {{ ansible_managed }} -->
<yandex>
<macros>
<cluster>{{ cluster }}</cluster>
<shard>{{ shard }}</shard>
<cluster>{{ clickhouse_cluster }}</cluster>
<shard>{{ clickhouse_shard }}</shard>
<replica>{{ inventory_hostname }}</replica>
<distributed_clusters>{{ distributed_cluster }}</distributed_clusters>
<distributed_clusters>{{ clickhouse_distributed_cluster }}</distributed_clusters>
</macros>
</yandex>
3 changes: 3 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
clickhouse_group: clickhouse
clickhouse_user: clickhouse
clickhouse_shard: 01
clickhouse_cluster: clickhouse-cluster
clickhouse_distributed_cluster: distributed_cluster

0 comments on commit e782589

Please sign in to comment.