简体   繁体   English

使用Tomcat配置群集和负载平衡的步骤?

[英]Steps to Configure the Clustering and Load balancing with Tomcat?

I recently learned the difference between Clustering and Load balancing . 我最近了解了群集负载平衡之间的区别。

I have an chat application and I need it to test with the load balancing and clustering. 我有一个聊天应用程序,我需要它来测试负载平衡和群集。

I googled a lot and can't get an exact answer . 我google了很多,无法得到确切的答案。

I don't know how to configure this with tomcat. 我不知道如何用tomcat配置它。

Hope our Stack users will give the best answer and will give the configuration steps and required servers and files for me. 希望我们的Stack用户能够给出最佳答案,并为我提供配置步骤和所需的服务器和文件。

Tomcat clustering typically means session replication - something that might not be what you expect when you have a chat application that is deployed on two servers. Tomcat群集通常意味着会话复制 - 当您在两台服务器上部署了聊天应用程序时,这可能不是您所期望的。 I'm afraid, I expect you will have to explicitly code some business-layer code to be able to have user 1, connected to tomcat 1, being able to chat to user 2 on tomcat 2. 我担心,我希望你必须明确地编写一些业务层代码才能拥有连接到tomcat 1的用户1,能够在tomcat 2上与用户2聊天。

Configuring tomcat as a cluster will help your loadbalancer to balance requests from tomcat 1 to tomcat 2 in the event that tomcat 1 will fail (typically the user continues to be logged in in a tomcat cluster installation). tomcat配置为集群将帮助您的负载均衡器在tomcat 1失败的情况下平衡从tomcat 1到tomcat 2的请求(通常用户继续在tomcat集群安装中登录)。 But it won't do anything to help your chat to be magically distributed between the two servers. 但它无法帮助您的聊天在两台服务器之间神奇地分布。

I'm suspecting that this is what got you puzzled - it seems to be something different compared to what you're looking for. 我怀疑这让你感到困惑 - 与你正在寻找的东西相比,它似乎有所不同。 (I'm only guessing this based on the little bit of information that you give) (我只是根据你提供的一点点信息猜测这个)

I'm afraid, I don't expect anybody to provide configuration files that will magically work (or I misinterpreted your question) 我担心,我不希望任何人提供神奇地工作的配置文件(或者我误解了你的问题)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM