Problems combining 'backup' command in upstream block with 'fair'-command

Dear users,

My first message here; I discussed my issue already with some folks on
IRC; my main conclusion was that I should try it with a broader
audience. So here’s the problem:

  • we’re using the ngx_http_upstream_module, and
    ngx_http_upstream_fair_module together with the HttpProxyModule

  • The ‘proxy’-configuration looks like this:
    location “/jvbnet/betsy/ip-vhost-trial/” {
    rewrite “^/jvbnet/betsy/ip-vhost-trial/(.*)$” “/$1” break;
    proxy_pass http://0893697e3d3e9e1a78d79c5d3b13c258;
    proxy_set_header Host rd.devel.xxx-xxxxx.nl;
    proxy_cache cache;
    }

  • There is a separate configuration file defining the upstream:
    upstream 0893697e3d3e9e1a78d79c5d3b13c258 {
    server 172.17.88.10;
    server 172.17.88.20 backup;
    fair;
    }

  • What I see:

  • If no connection can be made to 172.17.88.10 (because I switched off
    Apache over there), no roll-over to 172.17.88.20 happens

  • Next I remove the ‘fair’ command:
    upstream 0893697e3d3e9e1a78d79c5d3b13c258 {
    server 172.17.88.10;
    server 172.17.88.20 backup;
    }

  • Now, in the same situation, nginx -does- rollover to 172.17.88.20, as
    I expected

  • What I expected: nginx performing rollover in the first scenario

I get the same results if more non-backup servers are configured. And if
I put ‘fair’ as the first command in the initial scenario:
upstream 0893697e3d3e9e1a78d79c5d3b13c258 {
fair;
server 172.17.88.10;
server 172.17.88.20 backup;
}

the nginx configuration tester gives an error:
nginx: [emerg] invalid parameter “backup”

To me it seems that the fair-module does not cooperate properly with the
‘backup’ parameter. Did anyone else notice this problem, and if so, is
there a workaround/solution? Are there other configuration issues I may
have to check?

Sincerely,
Jakob van Bethlehem

Hello!

On Tue, Jun 11, 2013 at 02:19:46PM +0200, Jakob van Bethlehem wrote:

[…]

To me it seems that the fair-module does not cooperate properly with the
‘backup’ parameter. Did anyone else notice this problem, and if so, is there a
workaround/solution? Are there other configuration issues I may have to check?
The error message suggests that fair balancer isn’t able to work
with backup servers.

The error is only reported if a balancer is activated before
“server” directives as the check in question only done when
parsing “server” directives.


Maxim D.
http://nginx.org/en/donation.html