mash-playbook/docs/services/clickhouse.md
2023-07-07 14:43:28 +03:00

2.4 KiB

ClickHouse

ClickHouse 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 process:

########################################################################
#                                                                      #
# 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 and running a command like this:

BACKUP TABLE test TO Disk('backups', 'test.zip');

Read the Backup and Restore 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 tool, but this is not supported by the playbook yet.