Clustered Glassfish ESB with load balancer and single web service endpoint.

3 messages Options
Embed this post
Permalink
Magnus Smith

Clustered Glassfish ESB with load balancer and single web service endpoint.

Reply Threaded More More options
Print post
Permalink
I have the following setup.

Single glassfish server running a cluster with two instances instance1 and instance2 and a non-clustered server instance
GlassfishESB is installed and configured for clustering.
I have the BPEL persistence database setup with engineIds set correctly for instance1 and instance2

The clustered instances run a composite application that interacts with a client web application which runs on the non-clustered server instance using webservices.

There are two scenarios
(i) The clustered composite application calls a webservice on the client and receives a response  
 -- This works correctly.

(ii) The client calls a webservice on the clustered application and receives a response
 -- This is where I am stuck
       
I know that each cluster instance has its own http ports.  
I want a single endpoint for the webservice.
I trying to use the glassfish loadbalancer to achieve this.
       
The webservice that I wish to call on the clustered application has the following soap address :

soap:address location="http://localhost:9080/CivicaOutboundCompletionService/ESBCompletionBindingPort
       
Only webservices on this port should go to the cluster.  That is requests to the client application running on the non-clustered server instance should be be unaffected (scenario i).
       
When I go to the Glassfish web Admin Console and select new HTTP Load Balancer
       
I am asked to enter Device Host and Device Admin Port.
Should I be using localhost and 9080 for Device Host and Admin Port?
Should I use the settings for the glassfish server ie localhost and 4848 or something else?
       
Do I need to do anything else to configure the load balancer to work with webservices on my composite application such as setting a context?

Any suggesttions on how this should be done are very welcome as I am at a loss as what to do.

Many thanks

Magnus Smith
Rasta

Re: Clustered Glassfish ESB with load balancer and single web service endpoint.

Reply Threaded More More options
Print post
Permalink
Hi,

Please see some answers that could help:

Question: I am asked to enter Device Host and Device Admin Port.
Should I be using localhost and 9080 for Device Host and Admin Port?

    Web Server host and Web Server admin port should be used.

Question: Do I need to do anything else to configure the load balancer to work with
webservices on my composite application such as setting a context?

    Once loadbalancer plugin is setup and working (can follow http://blogs.sun.com/Prashanth/entry/setting_up_load_balancing_in), to setup webservices to work with LB define following can be added into loadbalancer.xml which is located under <webserver instance>/config directory

        <cluster name="cluster2" policy="round-robin">
            <instance disable-timeout-in-minutes="30" enabled="true" listeners="http://<instance1_host>:<instance1_soapPort>" name="instance-1" weight="100"/>
            <instance disable-timeout-in-minutes="30" enabled="true" listeners="http://<instance2_host>:<instance2_soapPort>" name="instance-2" weight="100"/>
            <web-module context-root="CivicaOutboundCompletionService" disable-timeout-in-minutes="30" enabled="true" error-url="sun-http-lberror.html"/>
            <health-checker interval-in-seconds="30" timeout-in-seconds="10" url="/"/>
          </cluster>


    In case .wsdl schema definition (.xsd) file is on different URI (usually in <compositeAppName>-sun-http-binding), it should be added as another web-module so the LB plugin can access .xsd file. eg.
    if .xsd is on

          <web-module context-root="CompositeAppName-sun-http-binding" disable-timeout-in-minutes="30" enabled="true" error-url="sun-http-lberror.html"/>

    If loadbalancer.xml configuration is manually edited, wadm pull-config command should be executed to get the configuration changes into web server configuration.

        <ws_install_dir>/bin/wadm pull-config --user=admin --host=<ws_host> --port=<ws_admin_port> --config=<ws_config>  <ws_host>

I hope this helps.
Rasta


Magnus Smith wrote:
I have the following setup.

Single glassfish server running a cluster with two instances instance1 and instance2 and a non-clustered server instance
GlassfishESB is installed and configured for clustering.
I have the BPEL persistence database setup with engineIds set correctly for instance1 and instance2

The clustered instances run a composite application that interacts with a client web application which runs on the non-clustered server instance using webservices.

There are two scenarios
(i) The clustered composite application calls a webservice on the client and receives a response  
 -- This works correctly.

(ii) The client calls a webservice on the clustered application and receives a response
 -- This is where I am stuck
       
I know that each cluster instance has its own http ports.  
I want a single endpoint for the webservice.
I trying to use the glassfish loadbalancer to achieve this.
       
The webservice that I wish to call on the clustered application has the following soap address :

soap:address location="http://localhost:9080/CivicaOutboundCompletionService/ESBCompletionBindingPort
       
Only webservices on this port should go to the cluster.  That is requests to the client application running on the non-clustered server instance should be be unaffected (scenario i).
       
When I go to the Glassfish web Admin Console and select new HTTP Load Balancer
       
I am asked to enter Device Host and Device Admin Port.
Should I be using localhost and 9080 for Device Host and Admin Port?
Should I use the settings for the glassfish server ie localhost and 4848 or something else?
       
Do I need to do anything else to configure the load balancer to work with webservices on my composite application such as setting a context?

Any suggesttions on how this should be done are very welcome as I am at a loss as what to do.

Many thanks

Magnus Smith
Magnus Smith

Re: Clustered Glassfish ESB with load balancer and single web service endpoint.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Magnus Smith
Thanks Rasta I have this all working now.

A few things that I learned along the way that might be of use to others

1)  Sun WebServer7 must be installed on another machine as I could not have an http listener with the same port as the port that the webservices were running on in the cluster.

2)  I installed the load balancer using the setup program for the Sun GlassFish Enterprise Server 2.1 with HABD.  There is no option to install the loadbalancer plugin to a web server in the non-HABD Sun GlassFish Enterprise Server 2.1 setup.

3)  The load balancer setup program makes a hugely dubious assumption that when you want to install the plugin to the webserver that you will also have an existing GlassFish on that same box.
If you don't do this then alarmingly the webserver instance won't start until you manually copy the following dlls from glassfish to

Sun\WebServer7\plugins\lbplugin\bin

icudt2.dll
icuin2.dll
icuuc2.dll
xerces-c.dll

4) In the Glassfish web Admin Console when creating the load balancer then the port that you enter must be the http admin port and not the https admin port of the webserver that is created by default.

Otherwise it all works well






Magnus Smith wrote:
I have the following setup.

Single glassfish server running a cluster with two instances instance1 and instance2 and a non-clustered server instance
GlassfishESB is installed and configured for clustering.
I have the BPEL persistence database setup with engineIds set correctly for instance1 and instance2

The clustered instances run a composite application that interacts with a client web application which runs on the non-clustered server instance using webservices.

There are two scenarios
(i) The clustered composite application calls a webservice on the client and receives a response  
 -- This works correctly.

(ii) The client calls a webservice on the clustered application and receives a response
 -- This is where I am stuck
       
I know that each cluster instance has its own http ports.  
I want a single endpoint for the webservice.
I trying to use the glassfish loadbalancer to achieve this.
       
The webservice that I wish to call on the clustered application has the following soap address :

soap:address location="http://localhost:9080/CivicaOutboundCompletionService/ESBCompletionBindingPort
       
Only webservices on this port should go to the cluster.  That is requests to the client application running on the non-clustered server instance should be be unaffected (scenario i).
       
When I go to the Glassfish web Admin Console and select new HTTP Load Balancer
       
I am asked to enter Device Host and Device Admin Port.
Should I be using localhost and 9080 for Device Host and Admin Port?
Should I use the settings for the glassfish server ie localhost and 4848 or something else?
       
Do I need to do anything else to configure the load balancer to work with webservices on my composite application such as setting a context?

Any suggesttions on how this should be done are very welcome as I am at a loss as what to do.

Many thanks

Magnus Smith