From da90b12643c0fbf5a5b3f6703fb8781cb13d2287 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 28 Aug 2020 14:20:13 +0100 Subject: [PATCH] Modify clickhouse settings so it's not a resource whore This means it can be moved back to ZFS! --- .../{clickhouse-docker.xml => clickhouse-config.xml} | 8 ++++++++ .../roles/plausible/files/clickhouse-user-config.xml | 7 +++++++ ansible/roles/plausible/files/docker-compose.yml | 3 ++- ansible/roles/plausible/tasks/main.yml | 11 +++++++++-- 4 files changed, 26 insertions(+), 3 deletions(-) rename ansible/roles/plausible/files/{clickhouse-docker.xml => clickhouse-config.xml} (61%) create mode 100644 ansible/roles/plausible/files/clickhouse-user-config.xml diff --git a/ansible/roles/plausible/files/clickhouse-docker.xml b/ansible/roles/plausible/files/clickhouse-config.xml similarity index 61% rename from ansible/roles/plausible/files/clickhouse-docker.xml rename to ansible/roles/plausible/files/clickhouse-config.xml index 4530dba..88fedf9 100644 --- a/ansible/roles/plausible/files/clickhouse-docker.xml +++ b/ansible/roles/plausible/files/clickhouse-config.xml @@ -5,5 +5,13 @@ 1 warning + true + + warning + + + warning> + + diff --git a/ansible/roles/plausible/files/clickhouse-user-config.xml b/ansible/roles/plausible/files/clickhouse-user-config.xml new file mode 100644 index 0000000..de336a2 --- /dev/null +++ b/ansible/roles/plausible/files/clickhouse-user-config.xml @@ -0,0 +1,7 @@ + + + + 0 + + + diff --git a/ansible/roles/plausible/files/docker-compose.yml b/ansible/roles/plausible/files/docker-compose.yml index 9d64482..dbfd529 100644 --- a/ansible/roles/plausible/files/docker-compose.yml +++ b/ansible/roles/plausible/files/docker-compose.yml @@ -32,8 +32,9 @@ services: image: yandex/clickhouse-server:latest restart: unless-stopped volumes: - - ./clickhouse:/var/lib/clickhouse + - /mnt/tank/dbs/clickhouse/plausible:/var/lib/clickhouse - /mnt/tank/dbs/clickhouse/docker_related_config.xml:/etc/clickhouse-server/config.d/docker_related_config.xml:ro + - /mnt/tank/dbs/clickhouse/docker_related_user_config.xml:/etc/clickhouse-server/users.d/docker_related_user_config.xml:ro tmpfs: - /var/log/clickhouse-server ulimits: diff --git a/ansible/roles/plausible/tasks/main.yml b/ansible/roles/plausible/tasks/main.yml index 64c9530..2f6996d 100644 --- a/ansible/roles/plausible/tasks/main.yml +++ b/ansible/roles/plausible/tasks/main.yml @@ -8,8 +8,15 @@ - name: Install clickhouse config template: - src: files/clickhouse-docker.xml - dest: /mnt/tank/dbs/clickhouse/docker_related_config.xml + src: files/clickhouse-config.xml + dest: /mnt/tank/dbs/clickhouse/docker_related_user_config.xml + notify: restart plausible + become: true + +- name: Install clickhouse user config + template: + src: files/clickhouse-user-config.xml + dest: /mnt/tank/dbs/clickhouse/docker_related_user_config.xml notify: restart plausible become: true