|   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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
 | global
    log 127.0.0.1:514 local2
    chroot /usr/local/haproxy
    pidfile /var/run/haproxy.pid
    nbproc 1
    nbthread 30
    hard-stop-after 1800s
    maxconn 32768
    user root
    group root
    daemon
    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats
defaults
    log global
    mode tcp
    option tcplog
    option dontlognull
    option abortonclose
    option redispatch
    retries 3
    maxconn 4096
    timeout check 10s
    timeout connect 3s
    timeout client 60s
    timeout server 60s
    timeout queue 60s
userlist admin_users
    user data password xxxxxxxx
#
# This sets up the admin page for HA Proxy at port 1080.
#
listen stats
    bind 0.0.0.0:1080
    balance
    mode http
    maxconn 32
    http-request use-service prometheus-exporter if { path /metrics }
    stats enable
    stats refresh 30s
    stats uri /
    acl auth_admin http_auth(admin_users)
    stats http-request auth realm Prove\ me\ baby unless auth_admin
    stats show-legends
# YARN resource manager
listen yarn_rm
    bind 0.0.0.0:8088
    mode http
    #option tcplog
    maxconn 4096
    timeout client 10s
    timeout client-fin 10s
    timeout connect 3s
    timeout server 10s
    timeout tunnel 60s
    timeout queue 60s
    balance roundrobin
    retries 3
    #server host200.internal host200.internal:14000 check rise 3 fall 3 maxconn 2048 maxqueue 128
    server host201.internal host201.internal:8088 redir http://host201:8088 check rise 3 fall 3 maxconn 2048 maxqueue 128
    server host202.internal host202.internal:8088 redir http://host202:8088 check rise 3 fall 3 maxconn 2048 maxqueue 128
#impala-shell
listen impalashell
    bind 0.0.0.0:21002
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 60s
    timeout client-fin 60s
    timeout connect 3s
    timeout server 60s
    timeout tunnel 600s
    timeout queue 60s
    balance roundrobin
    retries 3
    server host001.internal host001.internal:21000 check rise 3 fall 3 maxconn 1024 maxqueue 512 #coordinator
    server host002.internal host002.internal:21000 check rise 3 fall 3 maxconn 1024 maxqueue 512 #coordinator
    server host003.internal host003.internal:21000 check rise 3 fall 3 maxconn 1024 maxqueue 512 #coordinator
# impala jdbc
listen impalajdbc
    bind 0.0.0.0:21053
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 60s
    timeout client-fin 60s
    timeout connect 3s
    timeout server 60s
    timeout tunnel 600s
    timeout queue 60s
    balance leastconn
    retries 3
    server host007.internal host007.internal:21050 check rise 3 fall 3 maxconn 1024 maxqueue 512
    server host008.internal host008.internal:21050 check rise 3 fall 3 maxconn 1024 maxqueue 512
    server host009.internal host009.internal:21050 check rise 3 fall 3 maxconn 1024 maxqueue 512
    
# impala jdbc Hue
# Session stick is required for Hue, balance mode leastconn can't applied to Hue
listen impalajdbc_hue
    bind 0.0.0.0:21051
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 60s
    timeout client-fin 60s
    timeout connect 3s
    timeout server 60s
    timeout tunnel 600s
    timeout queue 60s
    balance source
    retries 3
    server host005.internal host005.internal:21050 check rise 3 fall 3 maxconn 1024 maxqueue 512
    server host006.internal host006.internal:21050 check rise 3 fall 3 maxconn 1024 maxqueue 512
# HiveServer2
listen hiveserver2
    bind 0.0.0.0:10001
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 60s
    timeout client-fin 60s
    timeout connect 3s
    timeout server 60s
    timeout tunnel 1800s
    timeout queue 60s
    balance source
    retries 3
    server host011.internal host011.internal:10000 check rise 3 fall 3 maxconn 1024 maxqueue 512
    server host012.internal host012.internal:10000 check rise 3 fall 3 maxconn 1024 maxqueue 512
# TiDB
listen tidb
    bind 0.0.0.0:3306
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 300s
    timeout client-fin 300s
    timeout connect 3s
    timeout server 300s
    timeout tunnel 1800s
    timeout queue 60s
    balance roundrobin
    retries 3
    option mysql-check user haproxy_check
    server host013.internal host013.internal:4000 check rise 3 fall 3 maxconn 1024 maxqueue 512 #disabled
    server host014.internal host014.internal:4000 check rise 3 fall 3 maxconn 1024 maxqueue 512 #disabled
    server host015.internal host015.internal:4000 check rise 3 fall 3 maxconn 1024 maxqueue 512 #disabled
# MySQL MHA
listen mysql_mha_master
    bind 0.0.0.0:3307
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 300s
    timeout client-fin 300s
    timeout connect 3s
    timeout server 300s
    timeout tunnel 1800s
    timeout queue 60s
    retries 3
    option mysql-check user haproxy_check
    server host016.internal host016.internal:3306 check rise 3 fall 3 maxconn 1024 maxqueue 512
# ClickHouse Client (TCP)
listen ck_app_tcp
    bind 0.0.0.0:9011
    mode tcp
    maxconn 200000
    timeout client 60s
    timeout client-fin 30s
    option tcplog
    option logasap
    option contstats
    timeout connect 5s
    timeout server 60s
    timeout tunnel 300s
    timeout server-fin 30s
    timeout queue 60s
    balance leastconn
    retries 3
    server host101.internal host101.internal:9011 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host102.internal host102.internal:9011 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host103.internal host103.internal:9011 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host104.internal host104.internal:9011 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host105.internal host105.internal:9011 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host106.internal host106.internal:9011 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    
# ClickHouse Client (HTTP)
listen ck_app_http
    bind 0.0.0.0:8123
    mode http
    maxconn 200000
    timeout client 60s
    timeout client-fin 30s
    option httplog
    option logasap
    option contstats
    timeout connect 5s
    timeout server 300s
    timeout tunnel 300s
    timeout server-fin 30s
    timeout queue 60s
    balance leastconn
    retries 3
    cookie SERVERID insert
    server host101.internal host101.internal:8123 check rise 3 fall 3 maxconn 10000 maxqueue 1000 cookie s1 #disabled
    server host102.internal host102.internal:8123 check rise 3 fall 3 maxconn 10000 maxqueue 1000 cookie s2 #disabled
    server host103.internal host103.internal:8123 check rise 3 fall 3 maxconn 10000 maxqueue 1000 cookie s3 #disabled
    server host104.internal host104.internal:8123 check rise 3 fall 3 maxconn 10000 maxqueue 1000 cookie s4 #disabled
    server host105.internal host105.internal:8123 check rise 3 fall 3 maxconn 10000 maxqueue 1000 cookie s5 #disabled
    server host106.internal host106.internal:8123 check rise 3 fall 3 maxconn 10000 maxqueue 1000 cookie s6 #disabled
# Prometheus Server basic
listen prometheus_server_basic
    bind 0.0.0.0:9099
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 300s
    timeout client-fin 300s
    timeout connect 3s
    timeout server 300s
    timeout tunnel 1800s
    timeout queue 60s
    retries 3
    server host301.internal host301.internal:8428 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host302.internal host302.internal:8428 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
    server host303.internal host303.internal:8428 check rise 3 fall 3 maxconn 10000 maxqueue 1000 #disabled
# Prometheus Pushgateway
listen prometheus_pushgateway_basic
    bind 0.0.0.0:9091
    mode tcp
    option tcplog
    maxconn 4096
    timeout client 300s
    timeout client-fin 300s
    timeout connect 3s
    timeout server 300s
    timeout tunnel 1800s
    timeout queue 60s
    retries 3
    server host301_9091.internal host301.internal:9091 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host301_9092.internal host301.internal:9092 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host301_9093.internal host301.internal:9093 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host301_9094.internal host301.internal:9094 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host302_9091.internal host302.internal:9091 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host302_9092.internal host302.internal:9092 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host302_9093.internal host302.internal:9093 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host302_9094.internal host302.internal:9094 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host303_9091.internal host303.internal:9091 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host303_9092.internal host303.internal:9092 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host303_9093.internal host303.internal:9093 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    server host303_9094.internal host303.internal:9094 check rise 3 fall 3 maxconn 10000 maxqueue 1024
    
errorfile 403 /etc/haproxy/errorfiles/403.http
errorfile 500 /etc/haproxy/errorfiles/500.http
errorfile 502 /etc/haproxy/errorfiles/502.http
errorfile 503 /etc/haproxy/errorfiles/503.http
errorfile 504 /etc/haproxy/errorfiles/504.http
 |