blob: 265ec7c9a915c8e3a75b848f90e16416c6936423 [file] [log] [blame]
Filip Pytloun48d38302015-10-06 16:28:31 +02001=======
2HAproxy
3=======
4
5The Reliable, High Performance TCP/HTTP Load Balancer.
6
Jiri Konecny371c6de2016-03-02 11:32:46 +01007
8Sample pillars
9==============
10
11Simple admin listener
12
13.. code-block:: yaml
14
15 haproxy:
16 proxy:
17 enabled: True
18 listen:
19 admin_page:
20 type: admin
21 binds:
22 - address: 0.0.0.0
23 port: 8801
24 user: fsdfdsfds
25 password: dsfdsf
26
27
28Simple stats listener
29
30.. code-block:: yaml
31
32 haproxy:
33 proxy:
34 enabled: True
35 listen:
36 admin_page:
37 type: stats
38 binds:
39 - address: 0.0.0.0
40 port: 8801
41
42
43
44Sample pillar with admin
Filip Pytloun48d38302015-10-06 16:28:31 +020045
46.. code-block:: yaml
47
48 haproxy:
49 proxy:
50 enabled: True
51 mode: http/tcp
Jiri Konecny371c6de2016-03-02 11:32:46 +010052 logging: syslog
Filip Pytloun48d38302015-10-06 16:28:31 +020053 max_connections: 1024
54 connect_timeout: 5000
55 client_timeout: 50000
56 server_timeout: 50000
57 listens:
58 - name: https-in
59 bind:
60 address: 0.0.0.0
61 port: 443
62 servers:
63 - name: server1
64 host: 10.0.0.1
65 port: 8443
66 - name: server2
67 host: 10.0.0.2
68 port: 8443
69 params: 'maxconn 256'
70
Jiri Konecny371c6de2016-03-02 11:32:46 +010071
Filip Pytloun48d38302015-10-06 16:28:31 +020072Sample pillar with custom logging
Filip Pytloun48d38302015-10-06 16:28:31 +020073
74.. code-block:: yaml
75
76 haproxy:
77 proxy:
78 enabled: True
79 mode: http/tcp
80 logging: syslog
81 max_connections: 1024
82 connect_timeout: 5000
83 client_timeout: 50000
84 server_timeout: 50000
85 listens:
86 - name: https-in
87 bind:
88 address: 0.0.0.0
89 port: 443
90 servers:
91 - name: server1
92 host: 10.0.0.1
93 port: 8443
94 - name: server2
95 host: 10.0.0.2
96 port: 8443
97 params: 'maxconn 256'
98
99.. code-block:: yaml
100
101 haproxy:
102 proxy:
103 enabled: true
104 mode: tcp
105 logging: syslog
106 max_connections: 1024
107 listens:
108 - name: mysql
109 type: mysql
110 binds:
111 - address: 10.0.88.70
112 port: 3306
113 servers:
114 - name: node1
115 host: 10.0.88.13
116 port: 3306
117 params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3
118 - name: node2
119 host: 10.0.88.14
120 port: 3306
121 params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup
122 - name: node3
123 host: 10.0.88.15
124 port: 3306
125 params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup
126 - name: rabbitmq
127 type: rabbitmq
128 binds:
129 - address: 10.0.88.70
130 port: 5672
131 servers:
132 - name: node1
133 host: 10.0.88.13
134 port: 5673
135 params: check inter 5000 rise 2 fall 3
136 - name: node2
137 host: 10.0.88.14
138 port: 5673
139 params: check inter 5000 rise 2 fall 3 backup
140 - name: node3
141 host: 10.0.88.15
142 port: 5673
143 params: check inter 5000 rise 2 fall 3 backup
144 -name: keystone-1
145 type: general-service
146 bins:
147 - address: 10.0.106.170
148 port: 5000
149 servers:
150 -name: node1
151 host: 10.0.88.13
152 port: 5000
153 params: check
154
155.. code-block:: yaml
156
157 haproxy:
158 proxy:
159 enabled: true
160 mode: tcp
161 logging: syslog
162 max_connections: 1024
163 listens:
164 - name: mysql
165 type: mysql
166 binds:
167 - address: 10.0.88.70
168 port: 3306
169 servers:
170 - name: node1
171 host: 10.0.88.13
172 port: 3306
173 params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3
174 - name: node2
175 host: 10.0.88.14
176 port: 3306
177 params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup
178 - name: node3
179 host: 10.0.88.15
180 port: 3306
181 params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup
182 - name: rabbitmq
183 type: rabbitmq
184 binds:
185 - address: 10.0.88.70
186 port: 5672
187 servers:
188 - name: node1
189 host: 10.0.88.13
190 port: 5673
191 params: check inter 5000 rise 2 fall 3
192 - name: node2
193 host: 10.0.88.14
194 port: 5673
195 params: check inter 5000 rise 2 fall 3 backup
196 - name: node3
197 host: 10.0.88.15
198 port: 5673
199 params: check inter 5000 rise 2 fall 3 backup
200 -name: keystone-1
201 type: general-service
202 bins:
203 - address: 10.0.106.170
204 port: 5000
205 servers:
206 -name: node1
207 host: 10.0.88.13
208 port: 5000
209 params: check
210
211Read more
212=========
213
214* https://github.com/jesusaurus/hpcs-salt-state/tree/master/haproxy
215* http://www.nineproductions.com/saltstack-ossec-state-using-reactor/ - example reactor usage.
216* https://gist.github.com/tomeduarte/6340205 - example on how to use peer from within a config file (using jinja)
217* http://youtu.be/jJJ8cfDjcTc?t=8m58s - from 9:00 on, a good overview of peer vs mine
218* https://github.com/russki/cluster-agents