Volver a los posts

Load Balancing Graylog2 with HAProxy and SRV records

If you ever happen to use HAProxy to make load balance to your Graylog2/GELF inputs (you should try it, HAProxy is HAwesome!), I advice you to take a look to Siaw Young’s post.

As a plus, you may be using SRV record sets to maintain your Graylog2 cluster node list up to date. If that applies to you, give it a try to haproxy-srv.

Looking for a starting template for haproxy-srv? Here you have!

{% raw  %}
{{#dns-srv "_gelf._tcp.internal.example.org"}}
listen gelf :12201
    mode tcp
    balance roundrobin
    option httpchk GET /api/system/lbstatus
    {{#each this}}
        server gelf-{{@index}} {{ip}}:{{port}} check port 12900
    {{/each}}
{{/dns-srv}}
{% endraw %}