概述
如下两个链接为中用到的配置文件
我们在自己配置过程中,可以参考这两个配置文件进行。本文围绕配置文件进一步说明JBoss 7/WildFly HornetQ Messaging 集群。HornetQ 服务器
两个节点中用到的配置文件standalone-full-ha-node1.xml和standalone-full-ha-node2.xml中都定义了两个HornetQ 服务器,即在<subsystem xmlns="urn:jboss:domain:messaging中有如下配置:
如上即两个节点中分别有现场服务器live-server和备份服务器backup-server。... ...
消息需要persistence-enabled
两个配置文件中的两个<hornetq-server>中persistence-enabled属性的配置为true,如下
消息只有在标记persistence-enabled为true时才可以在线程服务器和备份服务器之间复制,才能实现高可用。true
消息cluster-password
cluster-password用来在HornetQ 服务器之间复制消息使用,我们使用clusterPassword1!作为所有服务器之间的密码如下配置
clusterPassword1!
通过backup属性确定HornetQ 服务器是否为现场服务器
我们通过backup来确定HornetQ 服务器是否为现场服务器,如上两个节点中,线程服务器backup配置为true如下:
而备份服务器的配置为false
true
如何配置backup-group-name
我们示例中的两个节点共有两个Groups,即group-1和group-2,node1节点live-server和node2节点backup-server属于group-1,node2节点live-server和node1节点backup-server属于group-2,配置明细如下:
node1节点
node2节点group-1 group-2
group-2 group-1
不使用shared-store
我们知道JBoss 7/WildFly 中 HornetQ Messaging 集群有两种模式:Shared Store 和 Message Replication,Shared Store 需要依赖于高性能存储,所以我们通过配置
来使用Message Replication完成集群高可用false