views:

1547

answers:

2

i am planning to use 2 dedicated root servers rented at a hosting provider. those machines will run tomcat 6 in a cluster. if i will add additional machines later on - it is unlikely that they will be accessible with multicast, because they will be located in different subnets.

is it possible to run tomcat without multicast? all tutorials for tomcat 6 clustering include multicast heartbeat. are there any alternatives to SimpleTcpCluster?

or are other alternatives more appropriate in this situation?

+2  A: 

With no control over the distance between both servers (they might be in two different datacenters) and no dedicated inter-server-communication line, I'd rather run them via round-robin DNS or a loadbalancer that redirects clients to either www1.yourdomain.xxx or www2.yourdomain.xxx and handle server-communication carefully.

If the servers are heavily communicating with each other you might either look to change your architecture, optimize the hell out of your application to "fit" on one server (at least for a while) or go for dedicated hosting with control over the location, distance and cabling of your servers. Otherwise your inter-server-communication, heartbeat etc. would use the same channel as the clients that are communicating with it (e.g. the same network segment) which might slow everyone down.

If you are really expecting that much load I suppose there's at least some money involved, no? Use it wisely and use your setup skills for problems harder than setting up distributed clustering with no control or dedicated lines.

Olaf
+2  A: 

Seeing the comment to the question after having given my other answer I'm puzzled about what your question is... Is it about session replication? Cluster communication? It might be better to state your problem instead of your planned solution that has problems itself.

I'll state some possible problems together with quick answers:

Your application is CPU/RAM intensive

  • Profile it, optimize it, try again
  • Buy a bigger/better server

Your application is bandwidth intensive

  • using the cheapo clustering you mentioned in your question will most likely make it worse, as the same (cloaked) channel is used for inter-server-communication as for client-server communication
  • You might be able to separate different kinds of bandwidth e.g. by having dynamic content served from a different server than static content: No need for inter-server-communication here

Your application is storage intensive

  • get a bigger server
  • go for dedicated hosting and fit in as many spinning disks as you need
  • see if other models (like amazons S3 storage) might work for you)

Your application is likely to be slashdotted

  • determine which of the above factors (or others) are determining the limits of your application, fix that.

You just need session replication?

  • Tomcats SessionManager interface is small and can easily be implemented/extended yourself. Use it for any session replication you like. See the StandardManager documentation and implementation for more information

More ideas

  • look at more flexible setups like EC2 (amazon), googles offerings or other cloud computing setups. Make use of their own cloud-storage and inter-server-communication-facilities. Be careful to not depend too much on this infrastructure.

I certainly have forgotten something, but this might provide some starting point. Be more concrete about the nature of your underlying problem to get better answers :)

Olaf