You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Michele Mazzucco <Mi...@ncl.ac.uk> on 2008/10/20 15:58:17 UTC

dynamic load balancing

Hi all,

I'd like to use Synapse for load balancing across different clusters.  
In particular, I want not only to implement my own routing policy  
(which I know it's possible), but also to add new clusters at runtime  
(i.e. the possible destinations are not specified into a xml file).
I know I can implement it using just Axis2, but I was wondering  
whether it is possible to use Synapse (i.e. write less code). If this  
is the case, I'd really appreciate some pointers (I know Axis2 very  
well, but not Synapse).


Thanks in advance,
Michele

Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
Unfortunately, this feature was available only in the trunk, and it is
broken now, after the merging I think :(

Azeez

On Mon, Oct 20, 2008 at 8:19 PM, Afkham Azeez <af...@gmail.com> wrote:

> Hi Michele,
> You requirement seems to be dynamic groups. In Synapse we support dynamic
> membership within specified groups. I think what you mean by "new cluster"
> is actually a "new group". I don't think it is practically possible to
> dynamically add a new group at runtime.
>
> For dynamic load balancing with dynamic membership (with static groups),
> check out Synapse sample #57.
>
> I hope that I have understood your question correctly.
>
> HTH
> Azeez
>
>
> On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
> Michele.Mazzucco@ncl.ac.uk> wrote:
>
>> Hi all,
>>
>> I'd like to use Synapse for load balancing across different clusters. In
>> particular, I want not only to implement my own routing policy (which I know
>> it's possible), but also to add new clusters at runtime (i.e. the possible
>> destinations are not specified into a xml file).
>> I know I can implement it using just Axis2, but I was wondering whether it
>> is possible to use Synapse (i.e. write less code). If this is the case, I'd
>> really appreciate some pointers (I know Axis2 very well, but not Synapse).
>>
>>
>> Thanks in advance,
>> Michele
>>
>
>
>
> --
> Thanks
> Afkham Azeez
>
> Blog: http://afkham.org
> Developer Portal: http://www.wso2.org
> WSAS Blog: http://wso2wsas.blogspot.com
> Company: http://wso2.com
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>



-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
On a side note, I am currently working on an implementation which
automatically scales EC2 instances which are running Axis2 application
members fronted by a Synapse 2 node load balancer group. You will need to
use the WKA (Well-known Address) based membership management scheme I have
developed, in order to run this setup on EC2 (multicasting does not work).
This is a HA setup, and the entire cluster bootstraps off a single EC2
instance, which is provided with the cluster confiiguration.

Thnaks
Azeez

On Tue, Oct 21, 2008 at 4:27 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

> I think we are getting closer to the solution :), but:
>
> - The load balancers at level 1 (i.e. LB1, ...., LBn) are running Axis2
> (custom), not Synapse. I don't think it makes a lot of difference, does it?
> - What is the purpose of step # 1? I don't want to achieve replication, I
> only want to add new machines at runtime, if needed (i.e. Amazon EC2
> instances).
> - Should I customize the axis2.xml file or the synapse.xml on LB0? (step #
> 2)
> - How do I plug my custom routing policies in LB0?  (step # 3)
>
>
> Thanks,
> Michele
>
>
>
> On 21 Oct 2008, at 04:34, Afkham Azeez wrote:
>
>  The way I understand it, this is what needs to be done.
>>
>> You have two levels of  load balancers. At L0, you have the LB0 load
>> balancer. At L1, you have LB1, LB2, LB3... LBn. I'll assume that L0 & L1
>> load balancers are Synapse.
>>
>> Here is how such a deployment can be setup.
>>
>> 1. All L1 load balancers belong to the L1 group. This can be done by
>> enabling clustering in the axis2.xml file of each L1 load balancer,
>> setting
>> it to load balancer mode, and specifying that these load balancers belong
>> to
>> the L1 group. These changes have to be made to the cluster configuration
>> section in the axis2.xml file. You need to specify the applicationDomains
>> across which each L1 load balancer spreads the load.
>>
>> 2. Enable load balancer mode in the LB0 load balancer. Specify that the
>> applicationDomain across which the load has to be balanced as L1. Now, you
>> can add new L1 load balancers at runtime, provided that they are always
>> added to the L1 group.
>>
>> 3. Write your own LB algorithm, that will implement your load balancing
>> policy & plug it into the LB0 load balancer. The algorithm can be
>> specified
>> in the dynamic load balancer configuration section in the synapse.xml
>> file.
>> The default algorithm is round-robin, which will not be suitable in your
>> case.
>>
>> I'd recommend that you take a look at the dynamic load balancing sample
>> documentation to get a better idea.
>>
>> HTH
>> Azeez
>>
>> On Mon, Oct 20, 2008 at 8:54 PM, Michele Mazzucco <
>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>
>>  Hi Azeez,
>>>
>>> I think you misunderstood my requirements.
>>> I have different clusters (i.e. bunch of machines) exposing a certain
>>> number of web services. Each cluster has its own load balancer, policies,
>>> etc.
>>> What I want is  add another layer of indirection. Requests will pass
>>> through synapse and will be forwarded to the load balancers, according to
>>> my
>>> own policies. I want to be able to dynamically add new clusters at
>>> runtime.
>>> The final scenario is:
>>>
>>>
>>> Synapse------------>LB1--------> cluster 1
>>>               ------------>LB2 -------> cluster 2
>>>              etc.
>>>
>>>
>>> That is, clients send requests to the synapse machine, which will forward
>>> them to a certain load balancer LBn, which in turn will forward them to
>>> certain servers for execution.
>>>
>>>
>>> Hope everything is clear now.
>>> Michele
>>>
>>>
>>> On 20 Oct 2008, at 15:49, Afkham Azeez wrote:
>>>
>>>  Hi Michele,
>>>
>>>> You requirement seems to be dynamic groups. In Synapse we support
>>>> dynamic
>>>> membership within specified groups. I think what you mean by "new
>>>> cluster"
>>>> is actually a "new group". I don't think it is practically possible to
>>>> dynamically add a new group at runtime.
>>>>
>>>> For dynamic load balancing with dynamic membership (with static groups),
>>>> check out Synapse sample #57.
>>>>
>>>> I hope that I have understood your question correctly.
>>>>
>>>> HTH
>>>> Azeez
>>>>
>>>> On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
>>>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>>>
>>>>  Hi all,
>>>>
>>>>>
>>>>> I'd like to use Synapse for load balancing across different clusters.
>>>>> In
>>>>> particular, I want not only to implement my own routing policy (which I
>>>>> know
>>>>> it's possible), but also to add new clusters at runtime (i.e. the
>>>>> possible
>>>>> destinations are not specified into a xml file).
>>>>> I know I can implement it using just Axis2, but I was wondering whether
>>>>> it
>>>>> is possible to use Synapse (i.e. write less code). If this is the case,
>>>>> I'd
>>>>> really appreciate some pointers (I know Axis2 very well, but not
>>>>> Synapse).
>>>>>
>>>>>
>>>>> Thanks in advance,
>>>>> Michele
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> Thanks
>>>> Afkham Azeez
>>>>
>>>> Blog: http://afkham.org
>>>> Developer Portal: http://www.wso2.org
>>>> WSAS Blog: http://wso2wsas.blogspot.com
>>>> Company: http://wso2.com
>>>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>>>
>>>>
>>>
>>>
>>
>> --
>> Thanks
>> Afkham Azeez
>>
>> Blog: http://afkham.org
>> Developer Portal: http://www.wso2.org
>> WSAS Blog: http://wso2wsas.blogspot.com
>> Company: http://wso2.com
>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>
>
>


-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Azeez,

it does not compile any more, not the trunk nor revision 700319.  
There's a problem with the path somewhere (some classes are not found).

Michele


On 24 Oct 2008, at 12:20, Afkham Azeez wrote:

> Still we haven't been able to find the time to look into this.  
> Revision
> 700319 worked for me AFAICR. Can you please check with that  
> revision of the
> trunk?
>
> Thanks
> Azeez
>
> On Thu, Oct 23, 2008 at 10:54 PM, Michele Mazzucco <
> Michele.Mazzucco@ncl.ac.uk> wrote:
>
>> Azeez,
>>
>> sorry for putting "pressure" on you. Any news?
>>
>> Thanks,
>> Michele
>>
>>
>> On 22 Oct 2008, at 11:58, Afkham Azeez wrote:
>>
>>  Yeah, we will be fixing it shortly. I'll keep you informed.
>>>
>>> Thanks
>>> Azeez
>>>
>>> On Wed, Oct 22, 2008 at 2:47 PM, Michele Mazzucco <
>>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>>
>>>
>>>> On 21 Oct 2008, at 13:52, Afkham Azeez wrote:
>>>>
>>>>  Like I mentioned earlier, this would be much clear if you tried  
>>>> sample
>>>> 57.
>>>>
>>>>>
>>>>>
>>>> Didn't you tell me that it's broken?
>>>>
>>>> Michele
>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks
>>> Afkham Azeez
>>>
>>> Blog: http://afkham.org
>>> Developer Portal: http://www.wso2.org
>>> WSAS Blog: http://wso2wsas.blogspot.com
>>> Company: http://wso2.com
>>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>>
>>
>>
>
>
> -- 
> Thanks
> Afkham Azeez
>
> Blog: http://afkham.org
> Developer Portal: http://www.wso2.org
> WSAS Blog: http://wso2wsas.blogspot.com
> Company: http://wso2.com
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760


Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
Still we haven't been able to find the time to look into this. Revision
700319 worked for me AFAICR. Can you please check with that revision of the
trunk?

Thanks
Azeez

On Thu, Oct 23, 2008 at 10:54 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

> Azeez,
>
> sorry for putting "pressure" on you. Any news?
>
> Thanks,
> Michele
>
>
> On 22 Oct 2008, at 11:58, Afkham Azeez wrote:
>
>  Yeah, we will be fixing it shortly. I'll keep you informed.
>>
>> Thanks
>> Azeez
>>
>> On Wed, Oct 22, 2008 at 2:47 PM, Michele Mazzucco <
>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>
>>
>>> On 21 Oct 2008, at 13:52, Afkham Azeez wrote:
>>>
>>>  Like I mentioned earlier, this would be much clear if you tried sample
>>> 57.
>>>
>>>>
>>>>
>>> Didn't you tell me that it's broken?
>>>
>>> Michele
>>>
>>>
>>
>>
>> --
>> Thanks
>> Afkham Azeez
>>
>> Blog: http://afkham.org
>> Developer Portal: http://www.wso2.org
>> WSAS Blog: http://wso2wsas.blogspot.com
>> Company: http://wso2.com
>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>
>
>


-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Azeez,

sorry for putting "pressure" on you. Any news?

Thanks,
Michele

On 22 Oct 2008, at 11:58, Afkham Azeez wrote:

> Yeah, we will be fixing it shortly. I'll keep you informed.
>
> Thanks
> Azeez
>
> On Wed, Oct 22, 2008 at 2:47 PM, Michele Mazzucco <
> Michele.Mazzucco@ncl.ac.uk> wrote:
>
>>
>> On 21 Oct 2008, at 13:52, Afkham Azeez wrote:
>>
>>  Like I mentioned earlier, this would be much clear if you tried  
>> sample 57.
>>>
>>
>> Didn't you tell me that it's broken?
>>
>> Michele
>>
>
>
>
> -- 
> Thanks
> Afkham Azeez
>
> Blog: http://afkham.org
> Developer Portal: http://www.wso2.org
> WSAS Blog: http://wso2wsas.blogspot.com
> Company: http://wso2.com
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760


Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
Yeah, we will be fixing it shortly. I'll keep you informed.

Thanks
Azeez

On Wed, Oct 22, 2008 at 2:47 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

>
> On 21 Oct 2008, at 13:52, Afkham Azeez wrote:
>
>  Like I mentioned earlier, this would be much clear if you tried sample 57.
>>
>
> Didn't you tell me that it's broken?
>
> Michele
>



-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Yes, it's broken

INFO XMLConfigurationBuilder Generating the Synapse configuration  
model by parsing the XML configuration
ERROR SynapseConfigurationBuilder Could not initialize Synapse : null
java.lang.NullPointerException
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.handleException( 
EndpointFactory.java:476)
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFacto 
ry(EndpointFactory.java:440)
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFromE 
lement(EndpointFactory.java:67)
         at  
org.apache.synapse.config.xml.SendMediatorFactory.createMediator 
(SendMediatorFactory.java:90)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren 
(AbstractListMediatorFactory.java:39)
         at  
org.apache.synapse.config.xml.InMediatorFactory.createMediator 
(InMediatorFactory.java:47)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren 
(AbstractListMediatorFactory.java:39)
         at  
org.apache.synapse.config.xml.SequenceMediatorFactory.createMediator 
(SequenceMediatorFactory.java:79)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.defineSeque 
nce(SynapseXMLConfigurationFactory.java:170)
         at  
org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.getConfigur 
ation(SynapseXMLConfigurationFactory.java:77)
         at  
org.apache.synapse.config.xml.ConfigurationFactoryAndSerializerFinder.ge 
tConfiguration(ConfigurationFactoryAndSerializerFinder.java:160)
         at  
org.apache.synapse.config.xml.XMLConfigurationBuilder.getConfiguration 
(XMLConfigurationBuilder.java:46)
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration 
(SynapseConfigurationBuilder.java:78)
         at  
org.apache.synapse.core.axis2.SynapseInitializationModule.getConfigurati 
on(SynapseInitializationModule.java:158)
         at  
org.apache.synapse.core.axis2.SynapseInitializationModule.init 
(SynapseInitializationModule.java:89)
         at  
org.apache.axis2.context.ConfigurationContextFactory.initModules 
(ConfigurationContextFactory.java:248)
         at org.apache.axis2.context.ConfigurationContextFactory.init 
(ConfigurationContextFactory.java:226)
         at  
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration 
Context(ConfigurationContextFactory.java:93)
         at  
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration 
ContextFromFileSystem(ConfigurationContextFactory.java:206)
         at org.apache.synapse.ServerManager.start(ServerManager.java: 
108)
         at org.apache.synapse.SynapseServer.main(SynapseServer.java:82)
FATAL ServerManager Synapse startup failed...
org.apache.synapse.SynapseException: Could not initialize Synapse : null
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.handleException 
(SynapseConfigurationBuilder.java:95)
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration 
(SynapseConfigurationBuilder.java:88)
         at  
org.apache.synapse.core.axis2.SynapseInitializationModule.getConfigurati 
on(SynapseInitializationModule.java:158)
         at  
org.apache.synapse.core.axis2.SynapseInitializationModule.init 
(SynapseInitializationModule.java:89)
         at  
org.apache.axis2.context.ConfigurationContextFactory.initModules 
(ConfigurationContextFactory.java:248)
         at org.apache.axis2.context.ConfigurationContextFactory.init 
(ConfigurationContextFactory.java:226)
         at  
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration 
Context(ConfigurationContextFactory.java:93)
         at  
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration 
ContextFromFileSystem(ConfigurationContextFactory.java:206)
         at org.apache.synapse.ServerManager.start(ServerManager.java: 
108)
         at org.apache.synapse.SynapseServer.main(SynapseServer.java:82)
Caused by: java.lang.NullPointerException
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.handleException( 
EndpointFactory.java:476)
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFacto 
ry(EndpointFactory.java:440)
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFromE 
lement(EndpointFactory.java:67)
         at  
org.apache.synapse.config.xml.SendMediatorFactory.createMediator 
(SendMediatorFactory.java:90)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren 
(AbstractListMediatorFactory.java:39)
         at  
org.apache.synapse.config.xml.InMediatorFactory.createMediator 
(InMediatorFactory.java:47)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren 
(AbstractListMediatorFactory.java:39)
         at  
org.apache.synapse.config.xml.SequenceMediatorFactory.createMediator 
(SequenceMediatorFactory.java:79)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.defineSeque 
nce(SynapseXMLConfigurationFactory.java:170)
         at  
org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.getConfigur 
ation(SynapseXMLConfigurationFactory.java:77)
         at  
org.apache.synapse.config.xml.ConfigurationFactoryAndSerializerFinder.ge 
tConfiguration(ConfigurationFactoryAndSerializerFinder.java:160)
         at  
org.apache.synapse.config.xml.XMLConfigurationBuilder.getConfiguration 
(XMLConfigurationBuilder.java:46)
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration 
(SynapseConfigurationBuilder.java:78)
         ... 8 more
Exception in thread "main" org.apache.synapse.SynapseException:  
Synapse startup failed
         at org.apache.synapse.ServerManager.start(ServerManager.java: 
171)
         at org.apache.synapse.SynapseServer.main(SynapseServer.java:82)
Caused by: org.apache.synapse.SynapseException: Could not initialize  
Synapse : null
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.handleException 
(SynapseConfigurationBuilder.java:95)
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration 
(SynapseConfigurationBuilder.java:88)
         at  
org.apache.synapse.core.axis2.SynapseInitializationModule.getConfigurati 
on(SynapseInitializationModule.java:158)
         at  
org.apache.synapse.core.axis2.SynapseInitializationModule.init 
(SynapseInitializationModule.java:89)
         at  
org.apache.axis2.context.ConfigurationContextFactory.initModules 
(ConfigurationContextFactory.java:248)
         at org.apache.axis2.context.ConfigurationContextFactory.init 
(ConfigurationContextFactory.java:226)
         at  
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration 
Context(ConfigurationContextFactory.java:93)
         at  
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration 
ContextFromFileSystem(ConfigurationContextFactory.java:206)
         at org.apache.synapse.ServerManager.start(ServerManager.java: 
108)
         ... 1 more
Caused by: java.lang.NullPointerException
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.handleException( 
EndpointFactory.java:476)
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFacto 
ry(EndpointFactory.java:440)
         at  
org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFromE 
lement(EndpointFactory.java:67)
         at  
org.apache.synapse.config.xml.SendMediatorFactory.createMediator 
(SendMediatorFactory.java:90)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren 
(AbstractListMediatorFactory.java:39)
         at  
org.apache.synapse.config.xml.InMediatorFactory.createMediator 
(InMediatorFactory.java:47)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren 
(AbstractListMediatorFactory.java:39)
         at  
org.apache.synapse.config.xml.SequenceMediatorFactory.createMediator 
(SequenceMediatorFactory.java:79)
         at  
org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator 
(MediatorFactoryFinder.java:173)
         at  
org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.defineSeque 
nce(SynapseXMLConfigurationFactory.java:170)
         at  
org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.getConfigur 
ation(SynapseXMLConfigurationFactory.java:77)
         at  
org.apache.synapse.config.xml.ConfigurationFactoryAndSerializerFinder.ge 
tConfiguration(ConfigurationFactoryAndSerializerFinder.java:160)
         at  
org.apache.synapse.config.xml.XMLConfigurationBuilder.getConfiguration 
(XMLConfigurationBuilder.java:46)
         at  
org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration 
(SynapseConfigurationBuilder.java:78)
         ... 8 more



On 22 Oct 2008, at 10:17, Michele Mazzucco wrote:

>
> On 21 Oct 2008, at 13:52, Afkham Azeez wrote:
>
>> Like I mentioned earlier, this would be much clear if you tried  
>> sample 57.
>
> Didn't you tell me that it's broken?
>
> Michele


Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
On 21 Oct 2008, at 13:52, Afkham Azeez wrote:

> Like I mentioned earlier, this would be much clear if you tried  
> sample 57.

Didn't you tell me that it's broken?

Michele

Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
See answers inline.

On Tue, Oct 21, 2008 at 4:27 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

> I think we are getting closer to the solution :), but:
>
> - The load balancers at level 1 (i.e. LB1, ...., LBn) are running Axis2
> (custom), not Synapse. I don't think it makes a lot of difference, does it?

Yeah, you can write some code to do that I guess.

>
> - What is the purpose of step # 1? I don't want to achieve replication, I
> only want to add new machines at runtime, if needed (i.e. Amazon EC2
> instances).

The purpose of grouping  is not only replication. In Axis2 & Synapse both,
you can turn off replication while still allowing the members to be added to
the same group. This is just a mechanism for the underlying group
communication framework to handle these members as a single dynamic group.
So when you dynamically add new members to L1, the synapse load balancer at
L0 will automatically be notified using group communication.

>
> - Should I customize the axis2.xml file or the synapse.xml on LB0? (step #
> 2)

You will need to change both. In the axis2.xml, you will have to enable load
balancing & in the synapse.xml specify the dynamic load balance endpoint.
Like I mentioned earlier, this would be much clear if you tried sample 57.

>
> - How do I plug my custom routing policies in LB0?  (step # 3)

You can write your own load balancing algorithm which will process your
policy, and plug it in via the synapse.xml file.

>
>
>
> Thanks,
> Michele
>
>
>
> On 21 Oct 2008, at 04:34, Afkham Azeez wrote:
>
>  The way I understand it, this is what needs to be done.
>>
>> You have two levels of  load balancers. At L0, you have the LB0 load
>> balancer. At L1, you have LB1, LB2, LB3... LBn. I'll assume that L0 & L1
>> load balancers are Synapse.
>>
>> Here is how such a deployment can be setup.
>>
>> 1. All L1 load balancers belong to the L1 group. This can be done by
>> enabling clustering in the axis2.xml file of each L1 load balancer,
>> setting
>> it to load balancer mode, and specifying that these load balancers belong
>> to
>> the L1 group. These changes have to be made to the cluster configuration
>> section in the axis2.xml file. You need to specify the applicationDomains
>> across which each L1 load balancer spreads the load.
>>
>> 2. Enable load balancer mode in the LB0 load balancer. Specify that the
>> applicationDomain across which the load has to be balanced as L1. Now, you
>> can add new L1 load balancers at runtime, provided that they are always
>> added to the L1 group.
>>
>> 3. Write your own LB algorithm, that will implement your load balancing
>> policy & plug it into the LB0 load balancer. The algorithm can be
>> specified
>> in the dynamic load balancer configuration section in the synapse.xml
>> file.
>> The default algorithm is round-robin, which will not be suitable in your
>> case.
>>
>> I'd recommend that you take a look at the dynamic load balancing sample
>> documentation to get a better idea.
>>
>> HTH
>> Azeez
>>
>> On Mon, Oct 20, 2008 at 8:54 PM, Michele Mazzucco <
>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>
>>  Hi Azeez,
>>>
>>> I think you misunderstood my requirements.
>>> I have different clusters (i.e. bunch of machines) exposing a certain
>>> number of web services. Each cluster has its own load balancer, policies,
>>> etc.
>>> What I want is  add another layer of indirection. Requests will pass
>>> through synapse and will be forwarded to the load balancers, according to
>>> my
>>> own policies. I want to be able to dynamically add new clusters at
>>> runtime.
>>> The final scenario is:
>>>
>>>
>>> Synapse------------>LB1--------> cluster 1
>>>               ------------>LB2 -------> cluster 2
>>>              etc.
>>>
>>>
>>> That is, clients send requests to the synapse machine, which will forward
>>> them to a certain load balancer LBn, which in turn will forward them to
>>> certain servers for execution.
>>>
>>>
>>> Hope everything is clear now.
>>> Michele
>>>
>>>
>>> On 20 Oct 2008, at 15:49, Afkham Azeez wrote:
>>>
>>>  Hi Michele,
>>>
>>>> You requirement seems to be dynamic groups. In Synapse we support
>>>> dynamic
>>>> membership within specified groups. I think what you mean by "new
>>>> cluster"
>>>> is actually a "new group". I don't think it is practically possible to
>>>> dynamically add a new group at runtime.
>>>>
>>>> For dynamic load balancing with dynamic membership (with static groups),
>>>> check out Synapse sample #57.
>>>>
>>>> I hope that I have understood your question correctly.
>>>>
>>>> HTH
>>>> Azeez
>>>>
>>>> On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
>>>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>>>
>>>>  Hi all,
>>>>
>>>>>
>>>>> I'd like to use Synapse for load balancing across different clusters.
>>>>> In
>>>>> particular, I want not only to implement my own routing policy (which I
>>>>> know
>>>>> it's possible), but also to add new clusters at runtime (i.e. the
>>>>> possible
>>>>> destinations are not specified into a xml file).
>>>>> I know I can implement it using just Axis2, but I was wondering whether
>>>>> it
>>>>> is possible to use Synapse (i.e. write less code). If this is the case,
>>>>> I'd
>>>>> really appreciate some pointers (I know Axis2 very well, but not
>>>>> Synapse).
>>>>>
>>>>>
>>>>> Thanks in advance,
>>>>> Michele
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> Thanks
>>>> Afkham Azeez
>>>>
>>>> Blog: http://afkham.org
>>>> Developer Portal: http://www.wso2.org
>>>> WSAS Blog: http://wso2wsas.blogspot.com
>>>> Company: http://wso2.com
>>>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>>>
>>>>
>>>
>>>
>>
>> --
>> Thanks
>> Afkham Azeez
>>
>> Blog: http://afkham.org
>> Developer Portal: http://www.wso2.org
>> WSAS Blog: http://wso2wsas.blogspot.com
>> Company: http://wso2.com
>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>
>
>


-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
I think we are getting closer to the solution :), but:

- The load balancers at level 1 (i.e. LB1, ...., LBn) are running  
Axis2 (custom), not Synapse. I don't think it makes a lot of  
difference, does it?
- What is the purpose of step # 1? I don't want to achieve  
replication, I only want to add new machines at runtime, if needed  
(i.e. Amazon EC2 instances).
- Should I customize the axis2.xml file or the synapse.xml on LB0?  
(step # 2)
- How do I plug my custom routing policies in LB0?  (step # 3)


Thanks,
Michele


On 21 Oct 2008, at 04:34, Afkham Azeez wrote:

> The way I understand it, this is what needs to be done.
>
> You have two levels of  load balancers. At L0, you have the LB0 load
> balancer. At L1, you have LB1, LB2, LB3... LBn. I'll assume that L0  
> & L1
> load balancers are Synapse.
>
> Here is how such a deployment can be setup.
>
> 1. All L1 load balancers belong to the L1 group. This can be done by
> enabling clustering in the axis2.xml file of each L1 load balancer,  
> setting
> it to load balancer mode, and specifying that these load balancers  
> belong to
> the L1 group. These changes have to be made to the cluster  
> configuration
> section in the axis2.xml file. You need to specify the  
> applicationDomains
> across which each L1 load balancer spreads the load.
>
> 2. Enable load balancer mode in the LB0 load balancer. Specify that  
> the
> applicationDomain across which the load has to be balanced as L1.  
> Now, you
> can add new L1 load balancers at runtime, provided that they are  
> always
> added to the L1 group.
>
> 3. Write your own LB algorithm, that will implement your load  
> balancing
> policy & plug it into the LB0 load balancer. The algorithm can be  
> specified
> in the dynamic load balancer configuration section in the  
> synapse.xml file.
> The default algorithm is round-robin, which will not be suitable in  
> your
> case.
>
> I'd recommend that you take a look at the dynamic load balancing  
> sample
> documentation to get a better idea.
>
> HTH
> Azeez
>
> On Mon, Oct 20, 2008 at 8:54 PM, Michele Mazzucco <
> Michele.Mazzucco@ncl.ac.uk> wrote:
>
>> Hi Azeez,
>>
>> I think you misunderstood my requirements.
>> I have different clusters (i.e. bunch of machines) exposing a certain
>> number of web services. Each cluster has its own load balancer,  
>> policies,
>> etc.
>> What I want is  add another layer of indirection. Requests will pass
>> through synapse and will be forwarded to the load balancers,  
>> according to my
>> own policies. I want to be able to dynamically add new clusters at  
>> runtime.
>> The final scenario is:
>>
>>
>> Synapse------------>LB1--------> cluster 1
>>                ------------>LB2 -------> cluster 2
>>               etc.
>>
>>
>> That is, clients send requests to the synapse machine, which will  
>> forward
>> them to a certain load balancer LBn, which in turn will forward  
>> them to
>> certain servers for execution.
>>
>>
>> Hope everything is clear now.
>> Michele
>>
>>
>> On 20 Oct 2008, at 15:49, Afkham Azeez wrote:
>>
>>  Hi Michele,
>>> You requirement seems to be dynamic groups. In Synapse we support  
>>> dynamic
>>> membership within specified groups. I think what you mean by "new  
>>> cluster"
>>> is actually a "new group". I don't think it is practically  
>>> possible to
>>> dynamically add a new group at runtime.
>>>
>>> For dynamic load balancing with dynamic membership (with static  
>>> groups),
>>> check out Synapse sample #57.
>>>
>>> I hope that I have understood your question correctly.
>>>
>>> HTH
>>> Azeez
>>>
>>> On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
>>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>>
>>>  Hi all,
>>>>
>>>> I'd like to use Synapse for load balancing across different  
>>>> clusters. In
>>>> particular, I want not only to implement my own routing policy  
>>>> (which I
>>>> know
>>>> it's possible), but also to add new clusters at runtime (i.e. the
>>>> possible
>>>> destinations are not specified into a xml file).
>>>> I know I can implement it using just Axis2, but I was wondering  
>>>> whether
>>>> it
>>>> is possible to use Synapse (i.e. write less code). If this is  
>>>> the case,
>>>> I'd
>>>> really appreciate some pointers (I know Axis2 very well, but not
>>>> Synapse).
>>>>
>>>>
>>>> Thanks in advance,
>>>> Michele
>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks
>>> Afkham Azeez
>>>
>>> Blog: http://afkham.org
>>> Developer Portal: http://www.wso2.org
>>> WSAS Blog: http://wso2wsas.blogspot.com
>>> Company: http://wso2.com
>>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>>
>>
>>
>
>
> -- 
> Thanks
> Afkham Azeez
>
> Blog: http://afkham.org
> Developer Portal: http://www.wso2.org
> WSAS Blog: http://wso2wsas.blogspot.com
> Company: http://wso2.com
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760


Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
The way I understand it, this is what needs to be done.

You have two levels of  load balancers. At L0, you have the LB0 load
balancer. At L1, you have LB1, LB2, LB3... LBn. I'll assume that L0 & L1
load balancers are Synapse.

Here is how such a deployment can be setup.

1. All L1 load balancers belong to the L1 group. This can be done by
enabling clustering in the axis2.xml file of each L1 load balancer, setting
it to load balancer mode, and specifying that these load balancers belong to
the L1 group. These changes have to be made to the cluster configuration
section in the axis2.xml file. You need to specify the applicationDomains
across which each L1 load balancer spreads the load.

2. Enable load balancer mode in the LB0 load balancer. Specify that the
applicationDomain across which the load has to be balanced as L1. Now, you
can add new L1 load balancers at runtime, provided that they are always
added to the L1 group.

3. Write your own LB algorithm, that will implement your load balancing
policy & plug it into the LB0 load balancer. The algorithm can be specified
in the dynamic load balancer configuration section in the synapse.xml file.
The default algorithm is round-robin, which will not be suitable in your
case.

I'd recommend that you take a look at the dynamic load balancing sample
documentation to get a better idea.

HTH
Azeez

On Mon, Oct 20, 2008 at 8:54 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

> Hi Azeez,
>
> I think you misunderstood my requirements.
> I have different clusters (i.e. bunch of machines) exposing a certain
> number of web services. Each cluster has its own load balancer, policies,
> etc.
> What I want is  add another layer of indirection. Requests will pass
> through synapse and will be forwarded to the load balancers, according to my
> own policies. I want to be able to dynamically add new clusters at runtime.
> The final scenario is:
>
>
> Synapse------------>LB1--------> cluster 1
>                ------------>LB2 -------> cluster 2
>               etc.
>
>
> That is, clients send requests to the synapse machine, which will forward
> them to a certain load balancer LBn, which in turn will forward them to
> certain servers for execution.
>
>
> Hope everything is clear now.
> Michele
>
>
> On 20 Oct 2008, at 15:49, Afkham Azeez wrote:
>
>  Hi Michele,
>> You requirement seems to be dynamic groups. In Synapse we support dynamic
>> membership within specified groups. I think what you mean by "new cluster"
>> is actually a "new group". I don't think it is practically possible to
>> dynamically add a new group at runtime.
>>
>> For dynamic load balancing with dynamic membership (with static groups),
>> check out Synapse sample #57.
>>
>> I hope that I have understood your question correctly.
>>
>> HTH
>> Azeez
>>
>> On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
>> Michele.Mazzucco@ncl.ac.uk> wrote:
>>
>>  Hi all,
>>>
>>> I'd like to use Synapse for load balancing across different clusters. In
>>> particular, I want not only to implement my own routing policy (which I
>>> know
>>> it's possible), but also to add new clusters at runtime (i.e. the
>>> possible
>>> destinations are not specified into a xml file).
>>> I know I can implement it using just Axis2, but I was wondering whether
>>> it
>>> is possible to use Synapse (i.e. write less code). If this is the case,
>>> I'd
>>> really appreciate some pointers (I know Axis2 very well, but not
>>> Synapse).
>>>
>>>
>>> Thanks in advance,
>>> Michele
>>>
>>>
>>
>>
>> --
>> Thanks
>> Afkham Azeez
>>
>> Blog: http://afkham.org
>> Developer Portal: http://www.wso2.org
>> WSAS Blog: http://wso2wsas.blogspot.com
>> Company: http://wso2.com
>> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760
>>
>
>


-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Re: dynamic load balancing

Posted by "Asankha C. Perera" <as...@wso2.com>.
>> If all you want to do is have the ability dynamically route, you can 
>> easily use the DBLookup mediator, and lookup from a [dynamic] DB 
>> table on the target destination for a request, and forward it 
>> accordingly. This way, adding/removing rows to the table will result 
>> in your requirement
> No, this won't scale if the number of messages passing through Synapse 
> is high, because every time I should query the DB.
This can be easily solved using a cache..

asankha

Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
On 20 Oct 2008, at 17:31, Asankha C. Perera wrote:

> Michele
>> I think you misunderstood my requirements.
>> I have different clusters (i.e. bunch of machines) exposing a  
>> certain number of web services. Each cluster has its own load  
>> balancer, policies, etc.
>> What I want is  add another layer of indirection. Requests will  
>> pass through synapse and will be forwarded to the load balancers,  
>> according to my own policies. I want to be able to dynamically add  
>> new clusters at runtime.
>> The final scenario is:
>>
>>
>> Synapse------------>LB1--------> cluster 1
>>                 ------------>LB2 -------> cluster 2
>>                etc.
>>
>>
>> That is, clients send requests to the synapse machine, which will  
>> forward them to a certain load balancer LBn, which in turn will  
>> forward them to certain servers for execution.
> If all you want to do is have the ability dynamically route, you  
> can easily use the DBLookup mediator, and lookup from a [dynamic]  
> DB table on the target destination for a request, and forward it  
> accordingly. This way, adding/removing rows to the table will  
> result in your requirement


No, this won't scale if the number of messages passing through  
Synapse is high, because every time I should query the DB.


Michele


>
> asankha


Re: dynamic load balancing

Posted by "Asankha C. Perera" <as...@wso2.com>.
Michele
> I think you misunderstood my requirements.
> I have different clusters (i.e. bunch of machines) exposing a certain 
> number of web services. Each cluster has its own load balancer, 
> policies, etc.
> What I want is  add another layer of indirection. Requests will pass 
> through synapse and will be forwarded to the load balancers, according 
> to my own policies. I want to be able to dynamically add new clusters 
> at runtime.
> The final scenario is:
>
>
> Synapse------------>LB1--------> cluster 1
>                 ------------>LB2 -------> cluster 2
>                etc.
>
>
> That is, clients send requests to the synapse machine, which will 
> forward them to a certain load balancer LBn, which in turn will 
> forward them to certain servers for execution.
If all you want to do is have the ability dynamically route, you can 
easily use the DBLookup mediator, and lookup from a [dynamic] DB table 
on the target destination for a request, and forward it accordingly. 
This way, adding/removing rows to the table will result in your requirement

asankha

Re: dynamic load balancing

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Hi Azeez,

I think you misunderstood my requirements.
I have different clusters (i.e. bunch of machines) exposing a certain  
number of web services. Each cluster has its own load balancer,  
policies, etc.
What I want is  add another layer of indirection. Requests will pass  
through synapse and will be forwarded to the load balancers,  
according to my own policies. I want to be able to dynamically add  
new clusters at runtime.
The final scenario is:


Synapse------------>LB1--------> cluster 1
                 ------------>LB2 -------> cluster 2
                etc.


That is, clients send requests to the synapse machine, which will  
forward them to a certain load balancer LBn, which in turn will  
forward them to certain servers for execution.


Hope everything is clear now.
Michele

On 20 Oct 2008, at 15:49, Afkham Azeez wrote:

> Hi Michele,
> You requirement seems to be dynamic groups. In Synapse we support  
> dynamic
> membership within specified groups. I think what you mean by "new  
> cluster"
> is actually a "new group". I don't think it is practically possible to
> dynamically add a new group at runtime.
>
> For dynamic load balancing with dynamic membership (with static  
> groups),
> check out Synapse sample #57.
>
> I hope that I have understood your question correctly.
>
> HTH
> Azeez
>
> On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
> Michele.Mazzucco@ncl.ac.uk> wrote:
>
>> Hi all,
>>
>> I'd like to use Synapse for load balancing across different  
>> clusters. In
>> particular, I want not only to implement my own routing policy  
>> (which I know
>> it's possible), but also to add new clusters at runtime (i.e. the  
>> possible
>> destinations are not specified into a xml file).
>> I know I can implement it using just Axis2, but I was wondering  
>> whether it
>> is possible to use Synapse (i.e. write less code). If this is the  
>> case, I'd
>> really appreciate some pointers (I know Axis2 very well, but not  
>> Synapse).
>>
>>
>> Thanks in advance,
>> Michele
>>
>
>
>
> -- 
> Thanks
> Afkham Azeez
>
> Blog: http://afkham.org
> Developer Portal: http://www.wso2.org
> WSAS Blog: http://wso2wsas.blogspot.com
> Company: http://wso2.com
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760


Re: dynamic load balancing

Posted by Afkham Azeez <af...@gmail.com>.
Hi Michele,
You requirement seems to be dynamic groups. In Synapse we support dynamic
membership within specified groups. I think what you mean by "new cluster"
is actually a "new group". I don't think it is practically possible to
dynamically add a new group at runtime.

For dynamic load balancing with dynamic membership (with static groups),
check out Synapse sample #57.

I hope that I have understood your question correctly.

HTH
Azeez

On Mon, Oct 20, 2008 at 7:28 PM, Michele Mazzucco <
Michele.Mazzucco@ncl.ac.uk> wrote:

> Hi all,
>
> I'd like to use Synapse for load balancing across different clusters. In
> particular, I want not only to implement my own routing policy (which I know
> it's possible), but also to add new clusters at runtime (i.e. the possible
> destinations are not specified into a xml file).
> I know I can implement it using just Axis2, but I was wondering whether it
> is possible to use Synapse (i.e. write less code). If this is the case, I'd
> really appreciate some pointers (I know Axis2 very well, but not Synapse).
>
>
> Thanks in advance,
> Michele
>



-- 
Thanks
Afkham Azeez

Blog: http://afkham.org
Developer Portal: http://www.wso2.org
WSAS Blog: http://wso2wsas.blogspot.com
Company: http://wso2.com
GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760