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.

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

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?


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?


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.



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
Community showcase
Published in Off-topic

Run into these Solution Partners at Atlassian Open

Hey there Community! Atlassian Open is kicking off in less than a month and we can't wait to touch down in Vienna, Sydney and Boston. This is an opportunity to create the future of teamwork with ...

83 views 0 4
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you