UpstreamConsistentHash, is it wrong?

Mauro Stettler mauro.stettler at gmail.com
Fri Feb 19 18:07:29 MSK 2010


hi

the good news is, the consistent hash upstream module works with dns
now. the bad news is, it seems to be impossible to do this without
patching the nginx.

since i really don't like patching the nginx, i created a fork of my
module on github, which includes the patches that you have to apply on
the nginx. here you can download the updated module and the patches
for your nginx version from the branch "dns":

http://github.com/replay/ngx_http_consistent_hash/tree/dns

btw. do you have a setup where one dns entry points to multiple ips? i
implemented that it should balance between those ips, but didn't have
the setup to test it at hand. if yes, please report if that works.

mauro


On Wed, Feb 17, 2010 at 20:31, Markus Jelsma <markus at buyways.nl> wrote:
> For your information:
>
> I've sent Mauro the information a couple of days ago; it contained some
> sensitive information that's not suitable for the web.
>
> Anyway, Mauro found the issue and can perhaps fix it some day, here is a
> snippet from his reply mentioning the issue and a temporary work-around.
>
>
>>seems you found a real problem there... my nginx module creates the
>>hashring based on the ip's of the upstreams that you defined in the
>>config, while the memcache module creates it based on the exact string
>>that you gave it as server. which means the nginx does the dns
>>resolution first, the memcache module does it afterwards. could you
>>try writing the ips instead of the dns in your php?
>>
>>i will come up with a patch for this, but for now it should be ok by
>>writing just the ips.
>
> In other words, for now we must use only IP addresses in Python/PHP scripts as
> well as in the upstream configuration block. The work-around has been
> confirmed to work as Mauro says.
>
>
> Markus Jelsma - Technisch Architect - Buyways BV
> http://www.linkedin.com/in/markus17
> 050-8536620 / 06-50258350
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list