Welcome! Log In Create A New Profile

Advanced

Nnginx sticky module with no_fallback- How?

Posted by rits 
Nnginx sticky module with no_fallback- How?
December 21, 2015 06:52AM
Hi,

I am trying to use sticky module for sticky sessions based on cookies.

I have three backend servers, server1,server2,server3.

When all three are available, my sticky module is working fine.

upstream myLoadBalancerSSL {
sticky name=stickyRoute hash=sha1 no_fallback;
server 1;
server 2;
server 3;

}

I want to
1) When say server2 is down, and request comes with a cookie, instead of time out, client should immediately get a 502 (Bad Gateway or Proxy Error). But I tried both with and without no_fallback, requests from soapUI(woth cookies), are timing out. Please suggest a way to handle failure cases.
2) I am ok, if user get directed to next available server (his new session will be started- need to try this). Is there any way to redurect failure cases to the myLoadBalancerSSL upstream
3) As per description present in below blog, sticky module does a health check.

"http://nginx-load-balancing.blogspot.co.uk/search?updated-min=2013-01-01T00:00:00%2B05:30&updated-max=2014-01-01T00:00:00%2B05:30&max-results=6

ngx_http_get_sticky_peer is the callback set in the peer initialization function and is called at least once per request, to select the next peer. The function examines the state of the selected peer and ensures that it hasn't been tried or isn't down"

But I dont think it's happening. Requests keep going to unavailable server (with or bwithout cookies, in both case).

Manually marking the server down is only possible when we are aware the server is down. Think of the production scenario, where due to any reason, a server is down without we being immediately available or knowing about it.


I am new to nginx, is there a way without using Lua/OpenResty- a quick solution for fallback?
Re: Nnginx sticky module with no_fallback- How?
December 21, 2015 04:56PM
https://code.google.com/p/nginx-sticky-module/wiki/Documentation
http://dgtool.blogspot.nl/2013/02/nginx-as-sticky-balancer-for-ha-using.html

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready