Загрузить файлы в «/»
commit
b1058ec689
|
@ -0,0 +1,7 @@
|
|||
<clickhouse>
|
||||
<profiles>
|
||||
<default>
|
||||
<allow_experimental_database_replicated>1</allow_experimental_database_replicated>
|
||||
</default>
|
||||
</profiles>
|
||||
</clickhouse>
|
|
@ -0,0 +1,81 @@
|
|||
---
|
||||
- name: Preconfig
|
||||
hosts: bd
|
||||
tasks:
|
||||
|
||||
- name: Установка и настройка ClickHouse
|
||||
vars:
|
||||
cluster_name: testcluster
|
||||
|
||||
block:
|
||||
- name: Установка дополнительных пакетов
|
||||
apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- dirmngr
|
||||
update_cache: true
|
||||
|
||||
- name: Добавление ключа ClickHouse
|
||||
apt_key:
|
||||
id: "E0C56BD4"
|
||||
url: "http://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG"
|
||||
|
||||
- name: Добавление репозитория ClickHouse
|
||||
apt_repository:
|
||||
repo: deb https://repo.clickhouse.com/deb/stable/ main/
|
||||
state: present
|
||||
|
||||
- name: Установка ClickHouse
|
||||
apt:
|
||||
name:
|
||||
- clickhouse-server
|
||||
- clickhouse-client
|
||||
update_cache: true
|
||||
|
||||
- name: Копирование конфига keeper.xml
|
||||
template:
|
||||
src: keeper.xml.j2
|
||||
dest: /etc/clickhouse-server/config.d/keeper.xml
|
||||
owner: clickhouse
|
||||
group: clickhouse
|
||||
mode: 0400
|
||||
|
||||
- name: Копирование конфига cluster.xml
|
||||
template:
|
||||
src: cluster.xml.j2
|
||||
dest: /etc/clickhouse-server/config.d/cluster.xml
|
||||
owner: clickhouse
|
||||
group: clickhouse
|
||||
mode: 0400
|
||||
|
||||
- name: Копирование конфига macros.xml
|
||||
template:
|
||||
src: macros.xml.j2
|
||||
dest: /etc/clickhouse-server/config.d/macros.xml
|
||||
owner: clickhouse
|
||||
group: clickhouse
|
||||
mode: 0400
|
||||
|
||||
- name: Копирование конфига allow_replicated.xml
|
||||
copy:
|
||||
src: allow_replicated.xml
|
||||
dest: /etc/clickhouse-server/users.d/allow_replicated.xml
|
||||
owner: clickhouse
|
||||
group: clickhouse
|
||||
mode: 0400
|
||||
|
||||
- name: Копирование конфига listenhost.xml
|
||||
copy:
|
||||
src: listenhost.xml
|
||||
dest: /etc/clickhouse-server/config.d/listenhost.xml
|
||||
owner: clickhouse
|
||||
group: clickhouse
|
||||
mode: 0400
|
||||
|
||||
- name: Проверка корректности установки ClickHouse
|
||||
service:
|
||||
name: clickhouse-server
|
||||
state: restarted
|
||||
enabled: true
|
||||
become: true
|
|
@ -0,0 +1,20 @@
|
|||
<clickhouse>
|
||||
<remote_servers>
|
||||
<testcluster>
|
||||
<shard>
|
||||
<replica>
|
||||
<host>{{ hostvars['server1'].ansible_host }}</host>
|
||||
<port>9000</port>
|
||||
</replica>
|
||||
<replica>
|
||||
<host>{{ hostvars['server2'].ansible_host }}</host>
|
||||
<port>9000</port>
|
||||
</replica>
|
||||
<replica>
|
||||
<host>{{ hostvars['server3'].ansible_host }}</host>
|
||||
<port>9000</port>
|
||||
</replica>
|
||||
</shard>
|
||||
</testcluster>
|
||||
</remote_servers>
|
||||
</clickhouse>
|
|
@ -0,0 +1,9 @@
|
|||
[bd]
|
||||
server1 ansible_host=192.168.13.201 server_id=1
|
||||
server2 ansible_host=192.168.13.202 server_id=2
|
||||
server3 ansible_host=192.168.13.203 server_id=3
|
||||
|
||||
[all:vars]
|
||||
ansible_user=vagrant
|
||||
ansible_port=22
|
||||
ansible_ssh_private_key_file=~/.ssh/id_rsa.pub
|
|
@ -0,0 +1,45 @@
|
|||
<clickhouse>
|
||||
<keeper_server>
|
||||
<tcp_port>2181</tcp_port>
|
||||
<server_id>{{ server_id }}</server_id>
|
||||
<log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path>
|
||||
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>
|
||||
|
||||
<coordination_settings>
|
||||
<operation_timeout_ms>10000</operation_timeout_ms>
|
||||
<session_timeout_ms>30000</session_timeout_ms>
|
||||
<raft_logs_level>trace</raft_logs_level>
|
||||
<rotate_log_storage_interval>10000</rotate_log_storage_interval>
|
||||
</coordination_settings>
|
||||
|
||||
<raft_configuration>
|
||||
<server>
|
||||
<id>1</id>
|
||||
<hostname>{{ hostvars['server1'].ansible_host }}</hostname>
|
||||
<port>9444</port>
|
||||
</server>
|
||||
<server>
|
||||
<id>2</id>
|
||||
<hostname>{{ hostvars['server2'].ansible_host }}</hostname>
|
||||
<port>9444</port>
|
||||
</server>
|
||||
<server>
|
||||
<id>3</id>
|
||||
<hostname>{{ hostvars['server3'].ansible_host }}</hostname>
|
||||
<port>9444</port>
|
||||
</server>
|
||||
</raft_configuration>
|
||||
|
||||
</keeper_server>
|
||||
|
||||
<zookeeper>
|
||||
<node>
|
||||
<host>localhost</host>
|
||||
<port>2181</port>
|
||||
</node>
|
||||
</zookeeper>
|
||||
|
||||
<distributed_ddl>
|
||||
<path>/clickhouse/{{ cluster_name }}/task_queue/ddl</path>
|
||||
</distributed_ddl>
|
||||
</clickhouse>
|
Loading…
Reference in New Issue