It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Load Balancing of Datasources in Tomcat

Cofluence 3.1 on standalone with Oracle 10g Cluster.

In weblogic there is a multi datasource which from my understanding is load balancing between datasource 1 and datasource 2.

Is there a way to do this in Tomcat?

2 answers

1 accepted

2 votes
Answer accepted

Hi Bron,

I had a whole paragraph ready for you and then answers went down. SO, now I'm forced to retype what I typed up a couple hours ago before the site went down....

Ok. So what I said previously, was something like this. What I think you want to do is loadbalance apache in front of two tomcat instances that run against separate datasources.

https://confluence.atlassian.com/display/DOC/Apache+and+Tomcat+load+balancing

You'll do this with the mod_proxy and reference them via the workers.properties file in apache as described here:

https://wikis.nyu.edu/display/DOC/Apache+and+Tomcat+load+balancing

This doesn't seem as descriptive as my first response, but let me know if this points you in the right direction.

Hope this helps!

Each instance of tomcat would have a different server.xml with it's unique datasource.

Thanks Ryan.

I will try that. I was a little confused because with weblogic, the datasource listed in confluence-cfg.xml file on both nodes is the multi source(load balancing).

Are you saying I just configure datasource 1 in server.xml on node 1 and datasource 2 in server.xml on node 2 and then use the above to load balance between the two?

Thanks

Hi Bron,

Yup, that's exactly what I'm saying. The load balancer should handle.... balancing the load :) between the two tomcat instances. Each TC instance referencing it's own datasource. I'm wondering though, if you're referencing two different datasources, aren't you going to have two different sets of data? Is this a failover mechanism you're trying to put in place so that if you have to you can have database replication and then flip the switch to datasource 2?

Ryan

Hi Ryan,

Actually I have two nodes in a cluster with the same data. It is more of a failover mechanism, if one datasource is down it will switch to the other.

Thanks,

Bron

Understood. If that answers the solution for you let us know here!

Load balancing / failover shouldn't exactly happen at the data source layer. This should be done by the data source itself - virtual IPs, anycast on the dns or any other technical providing transparent load balancer / failover.

This should be independent of Tomcat.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published yesterday in Off-topic

Teams behind the teams - Your nominations please!

Teams do amazing things together. We’ve talked about the myth of the lone genius and how everything is actually the result of teamwork. You might be thinking, What about a novelist writing, say, Th...

143 views 1 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you