<div dir="ltr"><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0px 0px 0.25em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">Hi, I'm trying to building a syslog load balancer and I'm running into issues with the failover of UDP messages. TCP works just fine, when the server goes down, all messages failover to the active server. But with UDP, that does not happen. Maybe someone can point me to what I'm doing wrong. Below is the config.</p><pre class="gmail-_3GnarIQX9tD_qsgXkfSDz1" style="margin-top:4px;margin-bottom:4px;padding:8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:1.4;font-family:inherit;vertical-align:baseline;max-width:100%;overflow:auto;display:grid;color:rgb(26,26,27)"><code class="gmail-_34q3PgLsx9zIU5BiSOjFoM" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;font-size:13px;line-height:20px;font-family:"Noto Mono",Menlo,Monaco,Consolas,monospace;vertical-align:baseline;background-color:transparent;max-width:100%;overflow:auto">upstream syssrv {
server <a href="http://192.168.167.108:5500">192.168.167.108:5500</a> max_fails=2 fail_timeout=15s;
server <a href="http://192.168.167.109:5500">192.168.167.109:5500</a> max_fails=2 fail_timeout=15s;
}
server {
listen 5500;
proxy_protocol on;
proxy_pass syssrv;
proxy_timeout 1s;
proxy_connect_timeout 1s;
}
server {
listen 5500 udp;
proxy_pass syssrv;
proxy_timeout 1s;
proxy_connect_timeout 1s;
proxy_bind $remote_addr transparent;
}
}
</code></pre><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0.8em 0px 0.25em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">I have a script that enumerates each message (n) like this "Testing -proto: udp - n"</p><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0.8em 0px 0.25em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">I see both servers getting the message when they are online (even - odd numbers) but when one goes down, once server continues to only get the even numbers, so I'm losing 50% of the messages.</p><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0.8em 0px 0.25em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">I tried to debug the setup and I see nginx marking that the udp packets timed out. I see this:</p><pre class="gmail-_3GnarIQX9tD_qsgXkfSDz1" style="margin-top:4px;margin-bottom:4px;padding:8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:1.4;font-family:inherit;vertical-align:baseline;max-width:100%;overflow:auto;display:grid;color:rgb(26,26,27)"><code class="gmail-_34q3PgLsx9zIU5BiSOjFoM" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;font-size:13px;line-height:20px;font-family:"Noto Mono",Menlo,Monaco,Consolas,monospace;vertical-align:baseline;background-color:transparent;max-width:100%;overflow:auto">2022/02/22 20:05:13 [info] 21362#21362: *777 udp client <a href="http://192.168.167.101:51529">192.168.167.101:51529</a> connected to <a href="http://0.0.0.0:5500">0.0.0.0:5500</a>
2022/02/22 20:05:13 [info] 21362#21362: *777 udp proxy <a href="http://192.168.167.101:34912">192.168.167.101:34912</a> connected to <a href="http://192.168.167.108:5500">192.168.167.108:5500</a>
2022/02/22 20:05:13 [info] 21362#21362: *779 udp client <a href="http://192.168.167.101:53862">192.168.167.101:53862</a> connected to <a href="http://0.0.0.0:5500">0.0.0.0:5500</a>
2022/02/22 20:05:13 [info] 21362#21362: *779 udp proxy <a href="http://192.168.167.101:35506">192.168.167.101:35506</a> connected to <a href="http://192.168.167.109:5500">192.168.167.109:5500</a>
</code></pre><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0.8em 0px 0.25em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">Then this:</p><pre class="gmail-_3GnarIQX9tD_qsgXkfSDz1" style="margin-top:4px;margin-bottom:4px;padding:8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:1.4;font-family:inherit;vertical-align:baseline;max-width:100%;overflow:auto;display:grid;color:rgb(26,26,27)"><code class="gmail-_34q3PgLsx9zIU5BiSOjFoM" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;font-size:13px;line-height:20px;font-family:"Noto Mono",Menlo,Monaco,Consolas,monospace;vertical-align:baseline;background-color:transparent;max-width:100%;overflow:auto">2022/02/22 20:05:14 [info] 21362#21362: *771 udp timed out, packets from/to client:1/0, bytes from/to client:145/0, bytes from/to upstream:0/145
</code></pre><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0.8em 0px 0.25em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">But, it's not redirecting the connection to the healthy server. This seems pretty simple but any ideas what I'm doing wrong? It would seem that the non-commercial version should be able to do this, no?</p><p class="gmail-_1qeIAgB0cPwnLhDF9XSiJM" style="margin:0px;padding:0.8em 0px 0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;font-family:"Noto Sans",Arial,sans-serif;vertical-align:baseline;color:rgb(26,26,27)">Any help is appreciated. I also tried to add a backup, but it doesn't work with UDP</p><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Pawel</div></div>