Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Can`t create distributed clickhouse cluster #41

Open
patsevanton opened this issue Dec 31, 2019 · 1 comment
Open

Can`t create distributed clickhouse cluster #41

patsevanton opened this issue Dec 31, 2019 · 1 comment

Comments

@patsevanton
Copy link
Contributor

patsevanton commented Dec 31, 2019

Hello!
Can`t create distributed clickhouse cluster

  1. install zookeeper cluster
    inventory:
[zookeeper]
172.26.9.211 zookeeper_myid=1
172.26.9.212 zookeeper_myid=2
172.26.9.213 zookeeper_myid=3

[zookeeper-quorum]
host[1:3]

playbook

- hosts: zookeeper
  roles:
    - andrewrothstein.zookeeper-cluster
  1. install clickhouse cluster
    inventory:
[clickhouse_cluster]
172.26.9.211
172.26.9.212
172.26.9.213

playbook

- hosts: clickhouse_cluster
  become: yes
  vars:
    clickhouse_shards:
      your_shard_name:
        - { host: "172.26.9.211", port: 9000 }
        - { host: "172.26.9.212", port: 9000 }
        - { host: "172.26.9.213", port: 9000 }
    clickhouse_zookeeper_nodes:
      - { host: "172.26.9.211", port: 2181 }
      - { host: "172.26.9.212", port: 2181 }
      - { host: "172.26.9.213", port: 2181 }
  roles:
    - ansible-clickhouse

Config:

[root@nginx-log-collector-apatsev-2 ~]# cat /etc/clickhouse-server/config.xml |grep -A 10 remote
    <remote_servers incl="clickhouse_remote_servers" />


    <!-- If element has 'incl' attribute, then for it's value will be used corresponding substitution from another file.
         By default, path to file with substitutions is /etc/metrika.xml. It could be changed in config in 'include_from' element.
         Values for substitutions are specified in /yandex/name_of_substitution elements in that file.
      -->

    <!-- ZooKeeper is used to store metadata about replicas, when using Replicated tables.
         Optional. If you don't use replicated tables, you could omit that.
@shashankkoppar
Copy link

shashankkoppar commented May 26, 2020

I also had difficulties in beginning
inventory

[clickhouse-new]
clickhouse-new-1.c.clickhouse-poc.internal ansible_user=root ansible_python_interpreter=/usr/bin/python3
clickhouse-new-2.c.clickhouse-poc.internal ansible_user=root ansible_python_interpreter=/usr/bin/python3
clickhouse-new-3.c.clickhouse-poc.internal ansible_user=root ansible_python_interpreter=/usr/bin/python3

playbook

- name: clickhouse-new
  hosts: "clickhouse-new"
  become: true
  pre_tasks:
    - name: Install dirmngr
      apt:
        name: dirmngr
  roles:
     - geerlingguy.java
     - idealista.zookeeper_role
     - alexeysetevoi.clickhouse
  vars:
    clickhouse_users_custom:
        - { name: "admin",
            password_sha256_hex: "a2b82ec1e5005563d03e0d79098e5acdeb533c4824d2fac2cc79254428a7a409",
            networks: { 0.0.0.0/0 },
            profile: "default",
            quota: "default",
            comment: "admin user"}
    clickhouse_listen_host_default:
      - "::"
    clickhouse_shards:
      clickhouse_1:
        - { host: "clickhouse-new-1.c.clickhouse-poc.internal", port: 9000 }
      clickhouse_2:
        - { host: "clickhouse-new-2.c.clickhouse-poc.internal", port: 9000 }
      clickhouse_3:
        - { host: "clickhouse-new-3.c.clickhouse-poc.internal", port: 9000 }
    clickhouse_zookeeper_nodes:
      - { host: "clickhouse-new-1.c.clickhouse-poc.internal", port: 2181 }
      - { host: "clickhouse-new-2.c.clickhouse-poc.internal", port: 2181 }
      - { host: "clickhouse-new-3.c.clickhouse-poc.internal", port: 2181 }

got it working with this playbook

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants