Search Results

Search found 2 results on 1 pages for 'georgiy ivankin'.

Page 1/1 | 1 

  • How to make Nginx fire 504 immediately is server is not available?

    - by Georgiy Ivankin
    I have Nginx set up as a load balancer with cookie-based stickiness. The logic is: If the cookie is NOT there, use round-robbing to choose a server from cluster. If the cookie is there, go to the server that is associated with the cookie value. Server is then responsible for setting the cookie. What I want to add is this: If the cookie is there, but server is down, fallback to round-robbing step to choose next available server. So actually I have load balancing and want to add failover support on top of it. I have managed to do that with the help of error_page directive, but it doesn't work as I expected it to. The problem: 504 (and the fallback associated with it) fires only after 30s timeout even if the server is not physically available. So what I want Nginx to do is fire a 504 (or any other error, doesn't matter) immediately (I suppose this means: when TCP connection fails). This is the behavior we can see in browsers: if we go directly to server when it is down, browser immediately tells us that it can't connect. Moreover, Nginx seems to be doing this for 502 error: if I intentionally misconfigure my servers, Nginx fires 502 immediately. Configuration (stripped down to basics): http { upstream my_cluster { server 192.168.73.210:1337; server 192.168.73.210:1338; } map $cookie_myCookie $http_sticky_backend { default 0; value1 192.168.73.210:1337; value2 192.168.73.210:1338; } server { listen 8080; location @fallback { proxy_pass http://my_cluster; } location / { error_page 504 = @fallback; # Create a map of choices # see https://gist.github.com/jrom/1760790 set $test HTTP; if ($http_sticky_backend) { set $test "${test}-STICKY"; } if ($test = HTTP-STICKY) { proxy_pass http://$http_sticky_backend$uri?$args; break; } if ($test = HTTP) { proxy_pass http://my_cluster; break; } return 500 "Misconfiguration"; } } } Disclaimer: I am pretty far from systems administration of any kind, so there may be some basics that I miss here. EDIT: I'm interested in solution with standard free version of Nginx, not Nginx Plus. Thanks.

    Read the article

  • Why host and vmware guests fail to get MAC of each other?

    - by Georgiy Nemtsov
    I have Windows 7 64bit host running VmWare Workstation 8 with two CentOS 6.3 guests. All guests adaptors are bridged with statically assigned ip's. Connectivity bitween host and guests was fine for many days running this setup. And today while I was working suddenly host and guests became unreachable for each other. While both host and guests could connect to internet and connect to other mashines in my networks. On guests arp -a showed for host ip address: ? (192.168.1.3) <incomlete> on eth0 On host arp -a showed for guests ip 192.168.1.19 00-00-00-00-00-00 192.168.1.20 00-00-00-00-00-00 All other arp records was OK. Deleting arp-caches didn't help neither on guests nor on host. After that I disabled and reenabled network adaptor on my Windows 7 host. And the problem was gone. arp -a now shows correct MACs on all instances. As I suppose the issue was about expiry of arp cache. For some reason host and guests couldn't get their MACs. Hope somebody knows what it is all about? I am preparing guests to work in production and don't want to face such problems in future! Also I was supprised while investigating this issue from another mashine that could connect both on guests and host. On that mashine arp -a showed same MAC for host and two guests.

    Read the article

1