Forum

Posted by
ITANI Eiichiro  -  August 2011
Hi guys, could you advise me how to setup roxen under these condition?

  Host have multiple ip addresses (eg. 192.168.1.10, 192.168.1.20, etc.)
  Address 192.168.1.10 has name if1.localnet, 192.168.1.20 has name if2.localnet
  A roxen(4.5) instance have hostbased virtual servers (eg. srv1, srv2, ...)
  On this server, I must run multiple roxen instance.
  srv1 and srv2 are accessed through reverse proxy. (eg. srv1.example.com, srv2.example.com)

Under current conditions, reverse proxy directly connect to 192.168.1.10.
But I want to try load-balancing with LVS DR through VirtualIP 192.168.1.20.
So I want to configure server like this.

  srv1 listens on 192.168.1.10 and 192.168.1.20, this is default site.
  srv2 also listens on 192.168.1.10 and 192.168.1.20, host based.


On this host, other roxen instance listening on other ip address, so
binding '*' is not an option.

First try:
  In config srv1,

    <var name='MyWorldLocation'><str>http://srv1.example.com/</str></var>
    <var name='URLs'><a>
      <str>http://srv1.example.com/#ip=192.168.1.10;nobind=0</str>
      <str>http://srv1.example.com/#ip=192.168.1.20;nobind=0</str>
    </a></var>

  In config srv2,

    <var name='MyWorldLocation'><str>http://srv2.example.com/</str></var>
    <var name='URLs'><a>
      <str>http://srv2.example.com/#ip=192.168.1.10;nobind=0</str>
      <str>http://srv2.example.com/#ip=192.168.1.20;nobind=0</str>
    </a></var>

  Result:
    roxen only listen on 192.168.1.10.  Named V.host working.
    Globals/Ports tab shows
      http://192.168.1.10:80/
         http://srv1.example.com:80/ srv1
         http://srv2.example.com:80/ srv2

Second try:
  In config srv1,

    <var name='MyWorldLocation'><str>http://srv1.example.com/</str></var>
    <var name='URLs'><a>
      <str>http://srv1.example.com/#ip=192.168.1.10;nobind=0</str>
      <str>http://if2.localnet/#ip=192.168.1.20;nobind=0</str>
    </a></var>

  In config srv2,

    <var name='MyWorldLocation'><str>http://srv2.example.com/</str></var>
    <var name='URLs'><a>
      <str>http://srv2.example.com/#ip=192.168.1.10;nobind=0</str>
      <str>http://if2.localnet/#ip=192.168.1.20;nobind=0</str>
    </a></var>

  Result:
    After restart roxen, roxen listen on both IP but

    Globals/Ports tab shows
      http://192.168.1.10:80/
         http://srv1.example.com:80/ srv1
         http://srv2.example.com:80/ srv2
      http://192.168.1.20:80/
         http://srv1.example.com:80/ srv1

    Named V.host not working for 192.168.1.20.

Third try:
  In config srv1,

    <var name='MyWorldLocation'><str>http://srv1.example.com/</str></var>
    <var name='URLs'><a>
      <str>http://srv1.example.com/#ip=192.168.1.10;nobind=0</str>
      <str>http://dummysrv1/#ip=192.168.1.20;nobind=0</str>
    </a></var>

  In config srv2,

    <var name='MyWorldLocation'><str>http://srv2.example.com/</str></var>
    <var name='URLs'><a>
      <str>http://srv2.example.com/#ip=192.168.1.10;nobind=0</str>
      <str>http://dummysrv2/#ip=192.168.1.20;nobind=0</str>
    </a></var>

  Result:
    After restart, roxen listens on both IP, and

    Globals/Ports tab shows
      http://192.168.1.10:80/
         http://srv1.example.com:80/ srv1
         http://srv2.example.com:80/ srv2
      http://192.168.1.20:80/
         http://dummysrv1:80/ srv1
         http://dummysrv2:80/ srv2

    But when I access to 192.168.1.20:80, I must supply host header
    as "dummysrv2" to get content of srv2.

I guess if roxen is supporting multiple IP for one site, first setting
should work...

Could I have suggestions?
 
Posted by
Marcus Wellhardh  -  August 2011
Looks like this bug:

  https://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=5982

Does it work better if you restart after specifying configuring "first try"?

Is it an option to use alternative port numbers for the sites? LVS can port forward to a different ports on the real servers.
 
Posted by
ITANI Eiichiro  -  August 2011
Wow, thanks.  I didn't checked bts, sorry.

I applied chage in roxen.pike 1.1081 into roxen.pike of 4.5, and I restared server with "First try" configuration.  It worked as I expected.

Although site/ports tab shows wrong port configuration and Globals/ports shows correct info, as described in Gubba's comment, it's rather minor problem.

My hand patched version seems working, but could it be backported to 4.5 officially? Should I send my patch?
 
Posted by
Henrik Grubbstrom  -  August 2011
There were several reasons why I didn't backport it to older versions of Roxen, the main reason being that there was already support for binding multiple IPs (albeit undocumented); the IP field supports a comma-separated list of IP numbers.
 
Posted by
ITANI Eiichiro  -  August 2011
Although undocumented, will that comma-separated IP number list
be supported later versions?  Even if that feature will be dropped in later version, I'll be happy seeing announce it dropped in "changes" list.

Anyway, I'll use comma-separated version till I upgrade the server ;)
 
1
Search this thread: