• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache Tomcat clustering based on client's location

 
Jatin Sutaria
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a cluster of 2 servers running on different JVM's in different geographical locations - US and IN.

My requirement is getting an ability to dispatch requests to specific servers based on client's location - If some one in US hits the cluster URL, he should be dispatched to the server in US.

W.r.t this I have following queries -

1. Do we have an ability to do load balancing based on clien't i/p in Apache Tomcat? If yes, would appreciate if I get some pointers.

2. Secondly, if i can't do the former can I redirect client requests from server 1 - US to server 2 - IN before I hit any business logic in any of the servers. If that is possible I can have a servlet in front that decides where to delegate requests to based on client i/p and then do the redirection?

Thanks,
JS
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need load balancing for this? Because as I see it, this isn't really load balancing. It's just sharing the same URL for two different servers. Perhaps you can do something on a DNS level instead; for US users the DNS resolves the host name to the US server, for IN users the DNs resolves the host name to the IN server.
 
Jatin Sutaria
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob,

I guess I could do this if this is my only requirement. There are other use cases that may require clustering capabilities. I am not too sure if I can use the DNS level filtering for specific use cases ?. If that is the case, keeping clustering in mind, can we do something to achieve the goal?

Regards,
JS

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic