Filip Pytloun | 48d3830 | 2015-10-06 16:28:31 +0200 | [diff] [blame^] | 1 | ======= |
| 2 | HAproxy |
| 3 | ======= |
| 4 | |
| 5 | The Reliable, High Performance TCP/HTTP Load Balancer. |
| 6 | |
| 7 | Sample pillar |
| 8 | ============= |
| 9 | |
| 10 | .. code-block:: yaml |
| 11 | |
| 12 | haproxy: |
| 13 | proxy: |
| 14 | enabled: True |
| 15 | mode: http/tcp |
| 16 | max_connections: 1024 |
| 17 | connect_timeout: 5000 |
| 18 | client_timeout: 50000 |
| 19 | server_timeout: 50000 |
| 20 | listens: |
| 21 | - name: https-in |
| 22 | bind: |
| 23 | address: 0.0.0.0 |
| 24 | port: 443 |
| 25 | servers: |
| 26 | - name: server1 |
| 27 | host: 10.0.0.1 |
| 28 | port: 8443 |
| 29 | - name: server2 |
| 30 | host: 10.0.0.2 |
| 31 | port: 8443 |
| 32 | params: 'maxconn 256' |
| 33 | |
| 34 | Sample pillar with custom logging |
| 35 | ================================= |
| 36 | |
| 37 | .. code-block:: yaml |
| 38 | |
| 39 | haproxy: |
| 40 | proxy: |
| 41 | enabled: True |
| 42 | mode: http/tcp |
| 43 | logging: syslog |
| 44 | max_connections: 1024 |
| 45 | connect_timeout: 5000 |
| 46 | client_timeout: 50000 |
| 47 | server_timeout: 50000 |
| 48 | listens: |
| 49 | - name: https-in |
| 50 | bind: |
| 51 | address: 0.0.0.0 |
| 52 | port: 443 |
| 53 | servers: |
| 54 | - name: server1 |
| 55 | host: 10.0.0.1 |
| 56 | port: 8443 |
| 57 | - name: server2 |
| 58 | host: 10.0.0.2 |
| 59 | port: 8443 |
| 60 | params: 'maxconn 256' |
| 61 | |
| 62 | .. code-block:: yaml |
| 63 | |
| 64 | haproxy: |
| 65 | proxy: |
| 66 | enabled: true |
| 67 | mode: tcp |
| 68 | logging: syslog |
| 69 | max_connections: 1024 |
| 70 | listens: |
| 71 | - name: mysql |
| 72 | type: mysql |
| 73 | binds: |
| 74 | - address: 10.0.88.70 |
| 75 | port: 3306 |
| 76 | servers: |
| 77 | - name: node1 |
| 78 | host: 10.0.88.13 |
| 79 | port: 3306 |
| 80 | params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 |
| 81 | - name: node2 |
| 82 | host: 10.0.88.14 |
| 83 | port: 3306 |
| 84 | params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup |
| 85 | - name: node3 |
| 86 | host: 10.0.88.15 |
| 87 | port: 3306 |
| 88 | params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup |
| 89 | - name: rabbitmq |
| 90 | type: rabbitmq |
| 91 | binds: |
| 92 | - address: 10.0.88.70 |
| 93 | port: 5672 |
| 94 | servers: |
| 95 | - name: node1 |
| 96 | host: 10.0.88.13 |
| 97 | port: 5673 |
| 98 | params: check inter 5000 rise 2 fall 3 |
| 99 | - name: node2 |
| 100 | host: 10.0.88.14 |
| 101 | port: 5673 |
| 102 | params: check inter 5000 rise 2 fall 3 backup |
| 103 | - name: node3 |
| 104 | host: 10.0.88.15 |
| 105 | port: 5673 |
| 106 | params: check inter 5000 rise 2 fall 3 backup |
| 107 | -name: keystone-1 |
| 108 | type: general-service |
| 109 | bins: |
| 110 | - address: 10.0.106.170 |
| 111 | port: 5000 |
| 112 | servers: |
| 113 | -name: node1 |
| 114 | host: 10.0.88.13 |
| 115 | port: 5000 |
| 116 | params: check |
| 117 | |
| 118 | .. code-block:: yaml |
| 119 | |
| 120 | haproxy: |
| 121 | proxy: |
| 122 | enabled: true |
| 123 | mode: tcp |
| 124 | logging: syslog |
| 125 | max_connections: 1024 |
| 126 | listens: |
| 127 | - name: mysql |
| 128 | type: mysql |
| 129 | binds: |
| 130 | - address: 10.0.88.70 |
| 131 | port: 3306 |
| 132 | servers: |
| 133 | - name: node1 |
| 134 | host: 10.0.88.13 |
| 135 | port: 3306 |
| 136 | params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 |
| 137 | - name: node2 |
| 138 | host: 10.0.88.14 |
| 139 | port: 3306 |
| 140 | params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup |
| 141 | - name: node3 |
| 142 | host: 10.0.88.15 |
| 143 | port: 3306 |
| 144 | params: check inter 15s fastinter 2s downinter 1s rise 5 fall 3 backup |
| 145 | - name: rabbitmq |
| 146 | type: rabbitmq |
| 147 | binds: |
| 148 | - address: 10.0.88.70 |
| 149 | port: 5672 |
| 150 | servers: |
| 151 | - name: node1 |
| 152 | host: 10.0.88.13 |
| 153 | port: 5673 |
| 154 | params: check inter 5000 rise 2 fall 3 |
| 155 | - name: node2 |
| 156 | host: 10.0.88.14 |
| 157 | port: 5673 |
| 158 | params: check inter 5000 rise 2 fall 3 backup |
| 159 | - name: node3 |
| 160 | host: 10.0.88.15 |
| 161 | port: 5673 |
| 162 | params: check inter 5000 rise 2 fall 3 backup |
| 163 | -name: keystone-1 |
| 164 | type: general-service |
| 165 | bins: |
| 166 | - address: 10.0.106.170 |
| 167 | port: 5000 |
| 168 | servers: |
| 169 | -name: node1 |
| 170 | host: 10.0.88.13 |
| 171 | port: 5000 |
| 172 | params: check |
| 173 | |
| 174 | Read more |
| 175 | ========= |
| 176 | |
| 177 | * https://github.com/jesusaurus/hpcs-salt-state/tree/master/haproxy |
| 178 | * http://www.nineproductions.com/saltstack-ossec-state-using-reactor/ - example reactor usage. |
| 179 | * https://gist.github.com/tomeduarte/6340205 - example on how to use peer from within a config file (using jinja) |
| 180 | * http://youtu.be/jJJ8cfDjcTc?t=8m58s - from 9:00 on, a good overview of peer vs mine |
| 181 | * https://github.com/russki/cluster-agents |