-
Notifications
You must be signed in to change notification settings - Fork 2
/
exemple-loadbalancer.yml
55 lines (55 loc) · 1.22 KB
/
exemple-loadbalancer.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
---
- hosts: all
remote_user: root
roles:
- role: haproxy
haproxy_global:
debug: enable
user: haproxy
group: haproxy
description: "My HAProxy process"
maxconn: 8000
log:
- { bind: 127.0.0.1, facility: local0, level: info}
haproxy_default:
mode: http
retries: 10
options:
- httplog
- dontlognull
- http-server-close
- redispatch
timeout:
- http-request 5s
- queue 1m
- connect 5s
- client 1m
- server 1m
- http-keep-alive 10s
- check 5s
haproxy_frontends:
- name: loadbalancer
bind: '*:82'
default_backend: webserver-ext
- name: loadbalancer-int
bind: '*:8080'
default_backend: webserver-int
haproxy_backends:
- name: webserver-ext
balance: roundrobin
servers:
- name: backend1
ip: 192.168.0.100
port: 80
params:
- check
- name: backend1
ip: 192.168.0.101
port: 80
params:
- check
- name: webserver-int
servers:
- name: backend1
ip: 192.168.0.200
port: 80