Question about load balancing a SOAP Service

157 views
Skip to first unread message

norm.d...@gmail.com

unread,
Apr 9, 2014, 10:26:02 AM4/9/14
to membrane...@googlegroups.com
Hi there, please bear with me - I'm new to membrane.  Awesome product...
 
I have 1 web service that can be handled by 2 different servers - one is the primary and the other is a failover server.  The failover server is only up and running when the primary switches over to it.  They both serve the same service, except the WSDL locations are different ..
 
 
 
They are the exact same service, just a different server and different path.  What I would like to do is use Membrane to LoadBalance the SOAP service, depending on which server is up and running - the main goal is that the clients won't have to change their URL's for accessing the service if we failover. 
 
What I have been able to do is proxy the service to one server.  I can't get the soapProxy to come up for the other server because it is off-line since the primary is up and running. 
 
I'm not sure if I'm doing this correctly - I thought I would set up a soapProxy for each server, then a serviceProxy balancer to 'balance' between the 2 servers (utlimately only one would ever be up and running.  But the second soapProxy fails because the server isn't actually up and running - is there a way to bypass the check?  Is there a way to perhaps add another target to the first soapProxy service where it would go to one or the other depending on what is active?
 
Below is my test configuration - perhaps someone can provide some direction - am I doing this correctly or should I be doing this another way?
 
 <router>
 
  <soapProxy port="2000" wsdl="http://server1/q1i2/GetPatientInfo.CLS?WSDL=1">
   <path>/hhcpatientvisits</path>
   <ssl />
  </soapProxy>
<!--  <soapProxy port="2001" wsdl="http://server2/q2i2/GetPatientInfo.CLS?WSDL=1">
   <ssl />
  </soapProxy> -->
  <serviceProxy port="9000">
   <basicAuthentication>
    <user name="admin" password="membrane" />
   </basicAuthentication> 
   <adminConsole />
  </serviceProxy>
  <serviceProxy name="Balancer" port="9080">
   <path>/service</path>
   <balancer />
  </serviceProxy>
  <serviceProxy name="Up/Down Push Interface" port="9010">
   <clusterNotification />
  </serviceProxy>
  <serviceProxy name="PatientInfo Q1I2" port="2000">
   <counter name=Patient Info Q1I2" />
  </serviceProxy>
  <serviceProxy name="PatientInfo Q2I2" port="2001">
   <counter name="PatientInfo Q2I2" />
  </serviceProxy>
 </router>
 
</spring:beans>
Thanks in advance!
 
Norm Dressler

Thomas Bayer

unread,
Apr 10, 2014, 11:22:07 AM4/10/14
to membrane...@googlegroups.com
Hi,
a soapProxy is just a more convenient way to configure a serviceProxy out of data from WSDL. But I would stick with or start with a serviceProxy to do loadbalancing. Have a look at example/loadbalancer-static. It should solve everything but the different paths. I recommend to use the same paths for all the nodes. It gets much simpler:

        <serviceProxy name="Balancer" port="80">
            <balancer>
                <clusters>
                    <cluster name="Default">
                        <!-- In production replace this with your service nodes. -->                   
                        <node host="server1" port="80"/>
                        <node host="server2" port="80"/>
                    </cluster>
                </clusters>
            </balancer>
        </serviceProxy>

But if you want to keep the different paths use a config like the following. The balancer routes to two proxies that do the rewriting of the URL:

        <serviceProxy name="Balancer" port="8080">
            <balancer>
                <clusters>
                    <cluster name="Default">
                        <!-- In production replace this with your service nodes. -->                   
                        <node host="localhost" port="4000"/>
                        <node host="localhost" port="4001"/>
                    </cluster>
                </clusters>
            </balancer>
        </serviceProxy>
       
        <serviceProxy name="Rewriting for Node 1" port="4000">
            <target url="http://server1/q1i2/GetPatientInfo.CLS?WSDL=1"/>
        </serviceProxy>

        <serviceProxy name="Rewriting for Node 1" port="4000">
            <target url="http://server2/q2i2/GetPatientInfo.CLS?WSDL=1"/>
        </serviceProxy>
      
Hope that helps,
Thomas   


Am 09/04/14 16:26, schrieb norm.d...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "membrane-monitor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to membrane-monit...@googlegroups.com.
To post to this group, send email to membrane...@googlegroups.com.
Visit this group at http://groups.google.com/group/membrane-monitor.
For more options, visit https://groups.google.com/d/optout.

norm.d...@gmail.com

unread,
Apr 10, 2014, 4:22:59 PM4/10/14
to membrane...@googlegroups.com
Thank you Thomas - this works from what I can tell so far.  I need to do more testing on this - I still am not sure what would happen if the 1st server disappeared and how the clients would react.  

A followup question - is there a way to tell the balancer whether a host is up or down other then it trying to connect to the url?  In my case the URL is 'up' but any attempt to get a wsdl or post would result in an error.

norm.d...@gmail.com

unread,
Apr 15, 2014, 3:42:49 PM4/15/14
to membrane...@googlegroups.com
Bump... any suggestions here??

Thomas Bayer

unread,
Apr 16, 2014, 2:43:05 PM4/16/14
to membrane...@googlegroups.com


On Thursday, April 10, 2014 10:22:59 PM UTC+2, norm.d...@gmail.com wrote:
Thank you Thomas - this works from what I can tell so far.  I need to do more testing on this - I still am not sure what would happen if the 1st server disappeared and how the clients would react.  

If there is connection problem with one node, the balancer marks that node as down. The pending request is than routed to the next node. If that succeeds the client will not notice anything except perhaps a short delay. 
 

A followup question - is there a way to tell the balancer whether a host is up or down other then it trying to connect to the url?  In my case the URL is 'up' but any attempt to get a wsdl or post would result in an error.


Have a look at the loadbalance-client-2 example.

--
Thomas 
 
Reply all
Reply to author
Forward
0 new messages