有没有办法在分布式 ActiveMQ 集群中故障转移消息?
在分布式activemq集群中,如果一个节点发生故障,它的消息就会丢失,直到它恢复为止。即使节点发生故障,是否有办法继续分发这些消息?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
在分布式activemq集群中,如果一个节点发生故障,它的消息就会丢失,直到它恢复为止。即使节点发生故障,是否有办法继续分发这些消息?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
是的,您可以使用共享消息存储并让多个代理使用该存储来执行此操作。这些经纪人中只有一个在任何时候都会处于活动状态 - 第一个连接到商店的经纪人。这是通过锁来管理的。当活动代理失败时,第二个代理将获取锁,然后它变为活动状态,处理存储中第一个代理未发送的任何消息。客户端(生产者和消费者)通过连接字符串连接到代理对
。只有持有锁的代理才会接受连接,因此故障转移字符串指定客户端应尝试连接到列表中的下一个代理。使用这种机制,甚至可以让多个从设备等待在主设备发生故障时接管。
您可以在 http://activemq.apache.org 找到更多相关信息/shared-file-system-master-slave.html 如果您有权访问支持锁的网络文件系统(例如 SAN 或 NFS),或者如果没有,您可以使用数据库作为消息存储<一href="http://activemq.apache.org/jdbc-master-slave.html" rel="nofollow">http://activemq.apache.org/jdbc-master-slave.html
Yes, you do this using a shared message store and having multiple brokers use that store. Only one of these brokers will be active at any time - the one that connected to the store first. This is managed via locks. When the active broker falls over the second broker will pick up the lock and it then becomes active, handling any messages in the store that were not sent by the first broker. Clients (producers and consumers) connect to the broker pair via the connection string
Only the broker that holds the lock will accept connections, so the failover string specifies that the client should attempt to connect to the next broker in the list. Using this mechanism it is even possible to have multiple slaves waiting to take over if the master fails.
You can find more information about this at http://activemq.apache.org/shared-file-system-master-slave.html if you have access to a network file system that supports locks (such as a SAN, or NFS), or if not you can use a database as your message store http://activemq.apache.org/jdbc-master-slave.html
你想要
主从
哈吗?http://activemq.apache.org/masterslave.html
更多信息请参见: http://activemq.apache.org/replicated-message-store.html< /a>
Do you want the
master-slave
ha?http://activemq.apache.org/masterslave.html
More here: http://activemq.apache.org/replicated-message-store.html
创建一个代理网络,其中每个代理都有一个从属代理(例如直接复制)。
这样,如果主服务器发生故障,从服务器可以加入代理网络并取代其前主服务器的位置。根据您选择的复制方案,前主代理甚至可能恢复并作为从节点重新加入新主节点。
例如: 经纪人网络
据我所知,不可能“强制” “ activemq 冗余地存储挂起的消息几个经纪人。
create a broker network where every broker has a slave (for example with direct replication).
this way if the master fails the slave can join the broker network and take the position of its former master. depending on your chosen replication scheme the former master broker might even recover and rejoin the new master as a slave node.
for example: direct replication within a network of brokers
As far as i know its not possible to "force" activemq to store pending messages redundantly on several brokers.