开发者

How to route subdomains to one or more appropriate nodes within a cluster?

开发者 https://www.devze.com 2023-03-08 05:11 出处:网络
I am trying to solve a distributed computing architecture problem. Here is the scenario. Users come to my website and registers. As a part of the registration process they get a subdomain. For examp

I am trying to solve a distributed computing architecture problem. Here is the scenario.

Users come to my website and registers. As a part of the registration process they get a subdomain. For example, foo.xyz.com.

Now each users website is located/replicated on a one or more cluster nodes using some arbitrary scheme.

When the user request comes in (HTTP request via browser) , appropriate subdomain must be redirected to the matching cluster node. Essentially, I want my own dynamic domain name. I need to implement it in a fast and efficient way.

I've a java based web app开发者_如何学Clication which runs inside a Jetty7 container.

thanks,

NG


This definitely should be implemented outside of your application. Your Web application should be, as much as possible, agnostic from the way that requests get balanced in a cluster. The best performance you would get would be with hardware load balancers this one for example.

If you want to go for software based balancing I would configure Apache to serve as entry point and balance the traffic for your cluster with something like mod_proxy. See this tutorial that refers to Jetty.


have you taken a look at Nginx?Nginx may be more than your needs but it does effective job of routing subdomains to particular nodes.

0

精彩评论

暂无评论...
验证码 换一张
取 消