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 @ 2019-03-15 12:36  西门运维  阅读(1185)  评论(0编辑  收藏  举报