ActiveMq主从机制

搭建mq主从时会在数据库创建3张关于mq的表:

下面介绍ACTIVEMQ_LOCK这张表的作用:

Although the JDBC Store does not offer the best performance, it makes fairly simple to create a simple Master-Slave robust broker setup. 
When a group of Active MQ brokers is configured to use a shared database, they’ll all try to connect and grab a lock in the lock table,
but only one will succeed and become the master. The remaining brokers will be slaves, and will be in a wait state, not accepting client
connections until the master fails.
尽管JDBC存储并没有提供最佳的性能,但是它使创建一个简单的主-从健壮代理设置变得相当简单。当一组活动MQ代理被配置为使用共享数据库时,它们都将尝试连接并在锁表中获取锁,但只有一个代理将成功并成为主代理。其余的代理将成为奴隶,并处于等待状态,直到主服务器失败才接受客户机连接。
The lock table, is ACTIVEMQ_LOCK , and it is used to ensure that only one Active MQ broker instance can access the database at one time.
If an Active MQ broker can’t grab the database lock, that broker won’t initialize fully, and will wait until the lock becomes free, or it’s shut down.

ACTIVEMQ_LOCK是张锁表,它用于确保一次只能有一个活动MQ代理实例访问数据库。如果活动MQ代理无法获取数据库锁,则该代理将不会完全初始化,并将等待锁变为空闲状态,或者锁被关闭。



posted @   西门运维  阅读(1201)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
历史上的今天:
2018-03-15 mysql修改数据路径
点击右上角即可分享
微信分享提示