It is better to use the latest ClickHouse stable release.
Details can be read here.
For a basic standalone setup it is enough to do the following:
Add requirements:
# requirements.yml
---
roles:
- name: clickhouse
scm: git
src: git@github.com:semrush/ansible-role-clickhouse.git
version: 1.0.0
It is also recommended to add role to .gitignore
(or install it outside of
the repository), this will allow to keep things clean, i.e. you will not
randomly edit the roles file and later ansible-galaxy
may overwrite them
(though there is one exception to this rule -
ansible-pull
):
# .gitignore
/roles/clickhouse
And install the role:
ansible-galaxy install -r requirements.yml -p roles clickhouse
Add a simple playbook:
# clickhouse.yml
---
- name: Install ClickHouse
hosts: all
gather_facts: yes
roles:
- clickhouse
And run ansible:
ansible-playbook --become --diff clickhouse.yml
# ansible-playbook --become --diff -i CLICKHOUSE_HOST, clickhouse.yml
Here is an example patch, or the folder itself
See this page.
Developed with extensibility in mind (at least I hope)
Using YAML for configurations, and even though the syntax somewhere is tricky, it shows itself good.
For instance jinja2
natively render dict
in YAML
, so we don't need to
add additional loops over keys/values in the templates.
Provide sane defaults:
Enabled *_log
tables by default - usual problem for existing roles is
that they have a copy of config.xml
from a specific point in time, and
don't have new system tables.
TTL for *_log
tables
Enabled prometheus exported by default
Has extra metrics via http_handlers
See this page.
See this page.
See this page.
See this page.
You can create an issue here.
Please, add yourself to the adopters list (just send us merge request)!