Problem: cluster on JMS queue or EHCache to solve the pending activity tracking problem.
There are several cluster modes for ActiveMQ JMS.
Cluster Mode
1.Queue consumer clusters
If a consumer dies, any unacknowledged messages are redelivered to other consumers on the queue.
If one consumer is faster than the others it gets more messages etc. If any consumer slows down, other consumers pick up the slack.
So you can have a reliable load balanced cluster of consumers on a queue processing messages.
Solve problems:
It provides a good grid style processing model for consuming messages.
It doesn't help us to solve our problem.
2.Broker clusters
The most common mental model of clustering in a JMS context is that there is a collection of JMS brokers and a JMS client will connect to one of them,
then if the JMS broker goes down, it will auto-reconnect to another broker.
Solve problems:
It provides load-balance and fail-over mechanism.
But each broker has its own queue instance, so the queue is not really cluster.
It doesn't help us to solve our problem.
3.Master Slave
The idea behind MasterSlave is that messaages are replicated to a slave broker so that even if you have catastrophic hardware failure of the master's machine,
file system or data centre, you get immediate failover to the slave with no message loss.
There has 3 types of master-slave mode:
-------------------------------------
Mode: Pure Master Slave
Pros: No central point of failure.
Cons: Requires manual restart to bring back a failed master and can only support 1 slave.
-------------------------------------
Mode: Shared File System Master Slave
Pros: Run as many slaves as required. Automatic recovery of old masters.
Cons: Requires shared file system.
-------------------------------------
Mode: JDBC Master Slave
Pros: Run as many slaves as required. Automatic recovery of old masters.
Cons: Requires a shared database. Also relatively slow as it cannot use the high performance journal.
-------------------------------------
Solve problems:
If we want to have a fail-over solution, it is the solution.
And it only supports fail-over instead of load-balance.
But we still have the "non-shared cache" in the master and slave JMS webapp instances.
4.Replicated Message Stores
An alternative to MasterSlave is to have some way to replicate the message store.
It doesn't help us to solve the problem.
Conclusion
If we want to have a fail-over solution,
then 2 production applications will share the same JMS webapp instance using the "Master-Slave" mode.
It supports the fail-over mechanism instead of load-balance.
But if we don't care about the fail-over mechanism, we can just run 2 JMS webapp instances in production.
Since JMS doesn't support the really queue based cluster as we described before,
so we have to do the cluster based on the EHCache.
Reference
http://activemq.apache.org/clustering.html
http://activemq.apache.org/masterslave.html
分享到:
相关推荐
window搭建activeMQ集群(linux系统搭建集群的方式和window的一样),还有自己写的搭建集群的文档和我自己亲手搭建的一个三个mq集群
activemq集群方案.doc 服务器 集群 多节点
《RabbitMQ集群环境生产实例部署》《ActiveMQ集群》《ActiveMQ高可用+负载均衡集群的安装、配置、高可用测试》
ActiveMQ集群解析,详细讲解了详细中间件原理以及使用方法,非常基础的视频!!!
基于zookeeper+levelDB的ActiveMQ集群测试代码
ActiveMQ集群:网络连接模式(network connector)详解.docx
ActiveMQ集群配置,文档中介绍了如何通过集群的方式来配置ActiveMQ
activeMQ集群的使用与配置[收集].pdf
activeMQ集群的使用与配置[归类].pdf
实战ActiveMQ集群与应用实战视频教程实战
activemq集群配置文档
ActiveMQ集群实战教程
ActiveMq集群部署手册ActiveMq集群部署手册ActiveMq集群部署手册
这是介绍关于activemq 集群方面的资料,主要是理论性的资料
ActiveMQ集群安装和部署 很全的文档
activemq分布式集群视频教程,activemq分布式集群视频教程,activemq分布式集群视频教程,activemq分布式集群视频教程,activemq分布式集群视频教程
activemq集群配置文档
基于kahadb的activemq高可用集群部署配置示例,两个broker分别部署在两台机器上,一台机子上面,两个实例组成一个broker对外提供高可用服务,两个broker通过桥接形成集群服务