-
Notifications
You must be signed in to change notification settings - Fork 12
/
clickhouse_3zk-3shard-3replica.yml
130 lines (121 loc) · 3.01 KB
/
clickhouse_3zk-3shard-3replica.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Author: Al-assad
# Email: [email protected]
# Date: 2020-11-27
# Description: docker compose for clickhouse cluster with 3 shards and 1 replica, 3 zookeeper node
version: '2.1'
services:
zk1:
image: zookeeper:3.6
hostname: zk1
container_name: clickhouse-zookeeper-zk1
networks:
clickhouse-cluster:
ipv4_address: 172.18.1.2
environment:
ZOO_MY_ID: 1
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zk1:2888:3888 server.2=zk2:2888:3888 server.3=zk3:2888:3888
zk2:
image: zookeeper:3.6
hostname: zk2
container_name: clickhouse-zookeeper-zk2
networks:
clickhouse-cluster:
ipv4_address: 172.18.1.3
environment:
ZOO_MY_ID: 2
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zk1:2888:3888 server.2=zk2:2888:3888 server.3=zk3:2888:3888
zk3:
image: zookeeper:3.6
hostname: zk3
container_name: clickhouse-zookeeper-zk3
networks:
clickhouse-cluster:
ipv4_address: 172.18.1.4
environment:
ZOO_MY_ID: 3
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zk1:2888:3888 server.2=zk2:2888:3888 server.3=zk3:2888:3888
clickhouse1:
image: yandex/clickhouse-server:${CLICKHOUSE_VERSION:-20.11}
ports:
- "8124:8123"
hostname: ch01
container_name: clickhouse-server-ch01
ulimits:
nofile:
soft: 262144
hard: 262144
networks:
clickhouse-cluster:
ipv4_address: 172.18.1.5
extra_hosts:
- "zk1:172.18.1.2"
- "zk2:172.18.1.3"
- "zk3:172.18.1.4"
- "ch02:172.18.1.6"
- "ch03:172.18.1.7"
volumes:
- ./ch-conf_3zk-3shard-3replica/metrika_ch01.xml:/etc/metrika.xml
depends_on:
- "zk1"
- "zk2"
- "zk3"
clickhouse2:
image: yandex/clickhouse-server:${CLICKHOUSE_VERSION:-20.11}
ports:
- "8125:8123"
hostname: ch02
container_name: clickhouse-server-ch02
ulimits:
nofile:
soft: 262144
hard: 262144
networks:
clickhouse-cluster:
ipv4_address: 172.18.1.6
extra_hosts:
- "zk1:172.18.1.2"
- "zk2:172.18.1.3"
- "zk3:172.18.1.4"
- "ch01:172.18.1.5"
- "ch03:172.18.1.7"
volumes:
- ./ch-conf_3zk-3shard-3replica/metrika_ch02.xml:/etc/metrika.xml
depends_on:
- "zk1"
- "zk2"
- "zk3"
clickhouse3:
image: yandex/clickhouse-server:${CLICKHOUSE_VERSION:-20.11}
ports:
- "8126:8123"
hostname: ch03
container_name: clickhouse-server-ch03
ulimits:
nofile:
soft: 262144
hard: 262144
networks:
clickhouse-cluster:
ipv4_address: 172.18.1.7
extra_hosts:
- "zk1:172.18.1.2"
- "zk2:172.18.1.3"
- "zk3:172.18.1.4"
- "ch01:172.18.1.5"
- "ch02:172.18.1.6"
volumes:
- ./ch-conf_3zk-3shard-3replica/metrika_ch03.xml:/etc/metrika.xml
depends_on:
- "zk1"
- "zk2"
- "zk3"
networks:
clickhouse-cluster:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.18.1.0/16