diff --git a/docs/services/clickhouse.md b/docs/services/clickhouse.md new file mode 100644 index 0000000..28555ed --- /dev/null +++ b/docs/services/clickhouse.md @@ -0,0 +1,53 @@ +# ClickHouse + +[ClickHouse](https://clickhouse.com/) is an open-source column-oriented DBMS for online analytical processing (OLAP) that allows users to generate analytical reports using SQL queries in real-time. + +Some of the services installed by this playbook require a ClickHouse database. + +Enabling the ClickHouse database service will automatically wire all other services which require such a database to use it. + + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# clickhouse # +# # +######################################################################## + +clickhouse_enabled: true + +# Put a strong password below, generated with `pwgen -s 64 1` or in another way +clickhouse_root_passsword: '' + +######################################################################## +# # +# /clickhouse # +# # +######################################################################## +``` + +### Getting a database terminal + +You can use the `/mash/clickhouse/bin/cli` tool to get interactive terminal access to the ClickHouse server. + +## Upgrading ClickHouse + +ClickHouse is supposed to auto-upgrade its data as you upgrade to a newer version. There's nothing special that needs to be done. + +## Backing up ClickHouse + +The `/mash/clickhouse/backups` directory is mounted as `/backups` into the container and is an allowed disk for backups called `backups`. + +You can export a single database table by using [the CLI](#getting-a-database-terminal) and running a command like this: + +```sql +BACKUP TABLE test TO Disk('backups', 'test.zip'); +``` + +Read the [Backup and Restore](https://clickhouse.com/docs/en/operations/backup) article in the official documentation to learn more. + +For better (more en-masse) exporting, it may be beneficial to use the 3rd party [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) tool, but this is not supported by the playbook yet. diff --git a/docs/supported-services.md b/docs/supported-services.md index b650b80..e98bddf 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -6,6 +6,7 @@ | [AdGuard Home](https://adguard.com/en/adguard-home/overview.html/) | A network-wide DNS software for blocking ads & tracking | [Link](services/adguard-home.md) | | [Appsmith](https://www.appsmith.com/) | Platform for building and deploying custom internal tools and applications without writing code | [Link](services/appsmith.md) | | [authentik](https://goauthentik.io/) | An open-source Identity Provider focused on flexibility and versatility. | [Link](services/authentik.md) | +| [ClickHouse](https://clickhouse.com/) | An open-source column-oriented DBMS for online analytical processing (OLAP) that allows users to generate analytical reports using SQL queries in real-time. | [Link](services/clickhouse.md) | | [Collabora Online](https://www.collaboraoffice.com/) | Your Private Office Suite In The Cloud | [Link](services/collabora-online.md) | | [Docker](https://www.docker.com/) | Open-source software for deploying containerized applications | [Link](services/docker.md) | | [Docker Registry](https://docs.docker.com/registry/) | A container image distribution registry | [Link](services/docker-registry.md) | diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 1f2f242..90d227b 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -73,6 +73,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (authentik_worker_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'authentik']}] if authentik_enabled else []) + + ([{'name': (clickhouse_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'clickhouse']}] if clickhouse_enabled else []) + + ([{'name': (collabora_online_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'collabora-online']}] if collabora_online_enabled else []) + ([{'name': (devture_postgres_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'postgres']}] if devture_postgres_enabled else []) @@ -685,6 +687,34 @@ backup_borg_systemd_required_services_list: | +######################################################################## +# # +# clickhouse # +# # +######################################################################## + +clickhouse_enabled: false + +clickhouse_identifier: "{{ mash_playbook_service_identifier_prefix }}clickhouse" + +clickhouse_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}clickhouse" + +clickhouse_uid: "{{ mash_playbook_uid }}" +clickhouse_gid: "{{ mash_playbook_gid }}" + +# This will be extended in the future, to auto-create databases for services which depend on MariaDB. +# See `devture_postgres_managed_databases_auto` +# TODO +# clickhouse_managed_databases_auto: [] + +######################################################################## +# # +# /clickhouse # +# # +######################################################################## + + + ######################################################################## # # # collabora-online # diff --git a/requirements.yml b/requirements.yml index c90fec7..513a4e6 100644 --- a/requirements.yml +++ b/requirements.yml @@ -14,6 +14,9 @@ name: auxiliary - src: git+https://gitlab.com/etke.cc/roles/backup_borg.git version: v1.2.4-1.7.15-0 +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-clickhouse.git + version: v23.6.1.1524-0 + name: clickhouse - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-collabora-online.git version: v22.05.13.1.1-0 name: collabora_online diff --git a/setup.yml b/setup.yml index 9e2b933..aaa6f95 100644 --- a/setup.yml +++ b/setup.yml @@ -64,6 +64,8 @@ - role: galaxy/backup_borg + - role: galaxy/clickhouse + - role: galaxy/collabora_online - role: galaxy/docker_registry