Welcome! Log In Create A New Profile

Advanced

Load balancing syslog with UDP

Posted by jasonmclose 
Load balancing syslog with UDP
December 01, 2016 12:32PM
I am trying to use nginx as a load balancer for syslog, to be able to send logs to several downstream Graylog ingestors in order to help improve performance of the Graylog cluster.

I'm having trouble with the config, as I'm getting the error:
[error] 2813#2813: *210329 no live upstreams while connecting to upstream, udp client: 10.0.X.X, server: 0.0.0.0:11016, upstream: "port_11016_stream_backend", bytes from/to client:937/0, bytes from/to upstream:0/0

As a small example of my conf file, it looks like this:

stream {
server {
listen 11016 udp;
proxy_pass port_11016_stream_backend;
}

upstream port_11016_stream_backend {
server 10.0.X.Y:11016;
}
}

It's not going to receive any bytes back from the server because I want this to be UDP proxying, and ergo there will be no reply. How can I eliminate this error?
Re: Load balancing syslog with UDP
February 08, 2017 07:58AM
Hey facing similar situation. Was this solved?
Re: Load balancing syslog with UDP
February 08, 2017 08:23AM
Yes.

You have to set the proxy_responses field to 0.

So using my above example, it looks like:

stream {
server {
listen 11016 udp;
proxy_responses 0;
proxy_pass port_11016_stream_backend;
}

upstream port_11016_stream_backend {
server 10.0.X.Y:11016;
}
}
Re: Load balancing syslog with UDP
February 11, 2017 12:50AM
Hey thanks a lot. Will try that :)
Re: Load balancing syslog with UDP
August 06, 2024 01:11PM
i am also facing the same issue even i have already proxy_responses 0; is present in the conf file

Error which i am getting

[error] 662518#662518: *4354454 no live upstreams while connecting to upstream, udp client: 192.168.X.X, server: 0.0.0.0:9040, upstream: "beats_upstreams_9040", bytes from/to client:892/0, bytes from/to upstream:0/0



my configuration file

upstream beats_upstreams_9040 {
server 192.X.X.X:9040;
server 192.X.X.Y:9040;
}

server {
listen 9040 udp rcvbuf=8m;
proxy_pass beats_upstreams_9040;
proxy_bind $remote_addr transparent;
proxy_responses 0;
error_log /var/log/nginx/syslog-error-udp_9040.log;
}

server {
listen 9040;
proxy_pass beats_upstreams_9040;
#access_log /var/log/nginx/beats-plaintext-access_9040.log stream_debug;
error_log /var/log/nginx/beats-plaintext-error_9040.log;
}



Kindly give some clue to resolve this issue.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready