Active MQ 双主 和 mysql双主 方案测试
该方案目前存在问题,后续补充当前高可用方案。
ActiveMQ Master:
1.install monit
./configure && make && make install
2.config monit
check program peer_mq with path "/usr/local/bin/chk_peer_mq_monit.sh" with timeout 2 seconds
if status != 0 for 5 cycles then exec "/data/application/activemq/bin/activemq restart"
3.edite chk_peer_mq_monit.sh
#!/bin/sh
peer_status=`nc -z 10.9.80.124 61616|awk '{if($NF ~ "succeeded") {split($NF,s,"!");print s[1]} else {print "failed"}}'`
self_status=`nc -z 10.9.80.7 61616|awk '{if($NF ~ "succeeded") {split($NF,s,"!");print s[1]} else {print "failed"}}'`
if [[ $peer_status != "succeeded" ]] && [[ $self_status != "succeeded" ]];then
exit 3
fi
4.start monit
/usr/local/monit/bin/monit
ActiveMQ Slaver:
1.install monit
./configure && make && make install
2.config monit
check program peer_mq with path "/usr/local/bin/chk_peer_mq_monit.sh" with timeout 2 seconds
if status != 0 for 5 cycles then exec "/data/application/activemq/bin/activemq restart"
3.edite chk_peer_mq_monit.sh
#!/bin/sh
peer_status=`nc -z 10.9.80.7 61616|awk '{if($NF ~ "succeeded") {split($NF,s,"!");print s[1]} else {print "failed"}}'`
self_status=`nc -z 10.9.80.124 61616|awk '{if($NF ~ "succeeded") {split($NF,s,"!");print s[1]} else {print "failed"}}'`
if [[ $peer_status != "succeeded" ]] && [[ $self_status != "succeeded" ]];then
exit 3
fi
4.start monit
/usr/local/monit/bin/monit