how to load balancing ActiveMQ
heartstone Aug 16, 2014 7:11 AMWHo can explaine how to setup load balance amq cluster with master slave? I have two master slave pairs on computer1 and computer2.
Instances link to each other like -
node1-node3, node2-node3, node3-node1, node4-node2.
Master1-61617, Master2-61619, Slave1-61618, Slave2-61620
61617-61618 using postgres database
61619-61620 using postgres2 database
Here is scheme http://s32-temporary-files.radikal.ru/042d50c5372d4c0da9b1e4997f2b841e/-929206895.jpg
I have some questions.
1) Two masters, lock db, and slaves are waiting for master failure? So in webconsole we can see only master nodes?
2) Messages from master1 must forward to master2 for load balance on not?
Settings
Master1
transportconnector openwire 0.0.0.0:61617
<networkConnectors>
<networkConnector name="b1-b3-b4" uri="masterslave:(tcp://10.13.71.165:61619,tcp://10.13.71.165:61620)" />
</networkConnectors>
Slave1
transportconnector openwire 0.0.0.0:61618
<networkConnectors>
<networkConnector name="b2-b3-b4" uri="masterslave:(tcp://10.13.71.165:61619,tcp://10.13.71.165:61620)" />
</networkConnectors>
Master2
transportconnector openwire 0.0.0.0:61619
<networkConnectors>
<networkConnector name="b3-b1-b2" uri="masterslave:(tcp://10.13.71.100:61617,tcp://10.13.71.100:61618)" />
</networkConnectors>
Slave2
transportconnector openwire 0.0.0.0:61620
<networkConnectors>
<networkConnector name="b4-b2-b1" uri="masterslave:(tcp://10.13.71.100:61617,tcp://10.13.71.100:61618)" />
</networkConnectors>
Connecting consumer with failover:(tcp://10.13.71.100:61617,tcp://10.13.71.165:61619,tcp://10.13.71.100:61618,tcp://10.13.71.165:61620)?randomize=false
Producer connects with failover like consumer one. And what i see in webConsole? Number of consumers on each master nodes = 1.
Messages goes only on first Master node.
When i was set on each node <duplex true> <networkTTL=2,or 4> and ConduitSubscriptions=false, then on first node Number of consumers was =2, and messages were forward from 1st to 2nd node. What i'm doing wrong?