Nginx load balancer for graylog 3 nodes


(Kieulam141) #1

Hello guys,
Im new with graylog.I’m building a graylog cluster with 3 nodes and I want to load balancer throught Nginx.Does anyone has a clear tutorial for this.
Thank you.


(Artem Davydov) #2

hi, what are you plan to balance? web? gelf ?


(Kieulam141) #3

Thank for your rep.
I want to balance web.


(Artem Davydov) #4

server {
listen 80;
server_name examle.com;

    location / {
    proxy_pass  http://graylog-web-cluster;
    include     /etc/nginx/proxy.conf;
}

}

upstream graylog-web-cluster {
server 172.16.20.58:9200;
server 172.16.20.59:9200 backup;
}


(Jochen) #5

Take a look at http://docs.graylog.org/en/2.2/pages/configuration/web_interface.html and http://docs.graylog.org/en/2.2/pages/configuration/load_balancers.html for relevant hints.


(Kieulam141) #6

So in my each node graylog config file, Will i set “web_listen_uri = http://127.0.0.1:9200/” and “rest_listen_uri = http://127.0.0.1:9200/api/”, right ?


(Jochen) #7

No, that means that Graylog will only be reachable on the local machine (127.0.0.1 == localhost).


(Kieulam141) #8

so, in that options, what should i set them?


(Jochen) #9

Set both (rest_listen_uri and web_listen_uri) to the public IP addresses of the systems the respective Graylog instances are running on and configure you load balancer (nginx) to connect to all 3 of them.


(Kieulam141) #10

Thanks very much for your support.
I did it.


#11

Hi,
I installed a graylog cluster with three nodes. I also want to use nginx to load balancer, please share your nginx configuration to give me a help.
Thank you.


(Jochen) #12

@Shelin First, please don’t hijack old topics but open a new one for your own issues.
Second, there’s a working nginx configuration in the Graylog documentation: http://docs.graylog.org/en/2.4/pages/configuration/web_interface.html#nginx


(Jochen) #13