Nginx in UDP load balancing continue to send to an unreachable upstream server
1
vote
0
answers
352
views
I use Nginx to load balance traffic coming from udp syslog sources to logstash
Configuration :
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
worker_rlimit_nofile 1000000;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
include /etc/nginx/conf.d/*.conf;
#UDP syslog load balancing
stream {
server {
listen 514 udp;
proxy_pass logstash_servers;
proxy_timeout 1s;
proxy_responses 0;
proxy_bind $remote_addr transparent;
}
upstream logstash_servers {
server 192.168.2.90:514 fail_timeout=10s;
server 192.168.2.95:514 fail_timeout=10s;
}
}
It works fine but if one of my upstream logstash server is down, Nginx does not take it into account and I receive the half of message on the remaining upstream logstash server.
How can I tell to Nginx to use only the remaining logstash server if one is down ?
Asked by Atreiide
(11 rep)
Sep 30, 2021, 09:39 AM
Last activity: Sep 30, 2021, 09:57 AM
Last activity: Sep 30, 2021, 09:57 AM