-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-local-cluster-with-zookeeper.yml
111 lines (105 loc) · 4.14 KB
/
test-local-cluster-with-zookeeper.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
- hosts: localhost
remote_user: root
tasks:
- name: Create a ClickHouse docker network
docker_network:
name: ClickNetwork
ipam_options:
subnet: '172.1.1.0/24'
gateway: 172.1.1.100
iprange: '172.1.1.0/24'
- hosts: localhost
remote_user: root
tasks:
- name: Start Zookeeper container
docker_container:
name: "zookeeper-{{ item }}"
image: zookeeper:3.4.10
state: started
network_mode: bridge
networks:
- { name: "ClickNetwork", ipv4_address: "172.1.1.1{{ item }}" }
published_ports:
- "2181"
- "2888"
- "3888"
env:
ZOO_MY_ID: "{{ item }}"
ZOO_SERVERS: "server.1=172.1.1.11:2888:3888 server.2=172.1.1.12:2888:3888 server.3=172.1.1.13:2888:3888"
with_sequence: count=3
- hosts: localhost
remote_user: root
vars:
- clickhouse_docker_container_name: "clickhouse-1"
- clickhouse_docker_version: 1.1.54310
- clickhouse_docker_host_data_folder: "/tmp/docker-clickhouse-data/1"
- clickhouse_docker_host_config_folder: "/tmp/docker-clickhouse-config/1"
- clickhouse_docker_network_mode: bridge
- clickhouse_docker_networks:
- { name: "ClickNetwork", ipv4_address: "172.1.1.1" }
- clickhouse_docker_config:
interserver_http_host: 172.1.1.1
- clickhouse_docker_remote_servers:
test-cluster:
- shard: { replica: [ { host: 172.1.1.1, port: 9000 }, { host: 172.1.1.2, port: 9000 } ] } #1-shard with replica
- shard: { replica: [ { host: 172.1.1.3, port: 9000 } ] } #2-shard without replica
- clickhouse_docker_zookeeper_hosts:
- { index: 1, ip: 172.1.1.11, port: 2181 }
- { index: 2, ip: 172.1.1.12, port: 2181 }
- { index: 3, ip: 172.1.1.13, port: 2181 }
- clickhouse_docker_macros:
shard: 1
replica: 1
roles:
- ansible-role-docker-clickhouse
- hosts: localhost
remote_user: root
vars:
- clickhouse_docker_container_name: "clickhouse-2"
- clickhouse_docker_version: 1.1.54310
- clickhouse_docker_host_data_folder: "/tmp/docker-clickhouse-data/2"
- clickhouse_docker_host_config_folder: "/tmp/docker-clickhouse-config/2"
- clickhouse_docker_network_mode: bridge
- clickhouse_docker_networks:
- { name: "ClickNetwork", ipv4_address: "172.1.1.2" }
- clickhouse_docker_config:
interserver_http_host: 172.1.1.2
- clickhouse_docker_remote_servers:
test-cluster:
- shard: { replica: [ { host: 172.1.1.1, port: 9000 }, { host: 172.1.1.2, port: 9000 } ] } #1-shard with replica
- shard: { replica: [ { host: 172.1.1.3, port: 9000 } ] } #2-shard without replica
- clickhouse_docker_zookeeper_hosts:
- { index: 1, ip: 172.1.1.11, port: 2181 }
- { index: 2, ip: 172.1.1.12, port: 2181 }
- { index: 3, ip: 172.1.1.13, port: 2181 }
- clickhouse_docker_macros:
shard: 1
replica: 2
roles:
- ansible-role-docker-clickhouse
- hosts: localhost
remote_user: root
vars:
- clickhouse_docker_container_name: "clickhouse-3"
- clickhouse_docker_version: 1.1.54310
- clickhouse_docker_host_data_folder: "/tmp/docker-clickhouse-data/3"
- clickhouse_docker_host_config_folder: "/tmp/docker-clickhouse-config/3"
- clickhouse_docker_network_mode: bridge
- clickhouse_docker_networks:
- { name: "ClickNetwork", ipv4_address: "172.1.1.3" }
- clickhouse_docker_config:
interserver_http_host: 172.1.1.3
- clickhouse_docker_remote_servers:
test-cluster:
- shard: { replica: [ { host: 172.1.1.1, port: 9000 }, { host: 172.1.1.2, port: 9000 } ] } #1-shard with replica
- shard: { replica: [ { host: 172.1.1.3, port: 9000 } ] } #2-shard without replica
- clickhouse_docker_zookeeper_hosts:
- { index: 1, ip: 172.1.1.11, port: 2181 }
- { index: 2, ip: 172.1.1.12, port: 2181 }
- { index: 3, ip: 172.1.1.13, port: 2181 }
- clickhouse_docker_macros:
shard: 2
replica: 1
roles:
- ansible-role-docker-clickhouse