nl2go.clickhouse

Ansible Role: ClickHouse

This is an Ansible Role that helps you install and set up ClickHouse.

Role Variables

Here are the available settings you can change, along with their default values (check defaults/main.yml for details):

  • clickhouse_conf_dir: The directory where the server configuration is stored. Default is /etc/clickhouse-server.

  • clickhouse_loglevel: The level of details in the server logs. Default is information.

  • clickhouse_profiles:

    • default:
      • max_memory_usage: Maximum memory usage. Default is 10 billion bytes.
      • use_uncompressed_cache: Whether to use uncompressed cache. Default is 0 (no).
      • load_balancing: Method for load distribution. Default is "random".
  • users section (part of user.xml):

    • default:
      • password: Default password. Default is "qwerty".
      • profile: The profile to use. Default is "default".
      • quota: The quota to use. Default is "default".
  • Quota settings:

    • default:
      • intervals: Settings for tracking resource usage over time.
  • clickhouse_databases: List of databases to create in ClickHouse (e.g., these_metrics, other_metrics, imported_data).

  • clickhouse_zookeeper_hosts: List of Zookeeper nodes ClickHouse connects to for replication.

  • clickhouse_zookeeper_port: Port number for Zookeeper nodes. Default is 2181.

  • clickhouse_zookeeper_credentials: Format for authentication against Zookeeper (e.g., username:password).

  • clickhouse_path: Directory where ClickHouse will keep its data.

  • clickhouse_log_directory: Directory for logs (both errors and normal logs).

  • clickhouse_clusters: List of clusters and their shards.

Example:

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 }

Dependencies

There are no special dependencies.

Example Playbook

Here’s an example playbook to use this role:

- hosts: all
  roles:
    - nl2go.clickhouse

Development

To develop, use docker-molecule to run Molecule. It's also possible to install Molecule locally, but it might cause version conflicts.

Before running tests, provide your Hetzner Cloud token:

export HCLOUD_TOKEN=123abc456efg

Run tests using:

molecule test --all

Maintainers

License

For licensing details, check the LICENSE.md file.

Author Information

This role was created in 2020 by Sendinblue GmbH.

Informazioni sul progetto

An Ansible Role that manages installation and configuration of Yandex Clickhouse

Installa
ansible-galaxy install nl2go.clickhouse
Licenza
mit
Download
4.9k
Proprietario