ActiveMQ 2 ActiveMQ ReplicationLevelDB

2 篇文章 0 订阅
2 篇文章 0 订阅
这里只是简述我的配置以及碰到的问题.

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker"
...
<managementContext>
<managementContext createConnector="true"/>
</managementContext>

...
<persistenceAdapter>
<!-- <kahaDB directory="${activemq.data}/kahadb"/> -->
<!-- <jdbcPersistenceAdapter dataSource="#mysql-ds" /> -->
<replicatedLevelDB
directory="${activemq.data}/leveldb"
replicas="3"
bind="tcp://0.0.0.0:0"
zkAddress="192.168.1.210:2181,192.168.1.211:2181,192.168.1.212:2181"
zkPath="/activemq/leveldb-stores"
hostname="192.168.1.210"
sync="local_disk"
/>
</persistenceAdapter>

...
</broker>


要求使用failover协议
[quote]failover:(tcp://192.168.1.210:61616,tcp://192.168.1.211:61616,tcp://192.168.1.212:61616)[/quote]


问题一:
关闭ActiveMQ时异常
[quote]
Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException
[/quote]

将 <managementContext createConnector="[color=red]true[/color]"/> 改为 true,默认是false.

问题二:
测试时使用了3个ActiveMQ集群Master-Slave, 比如我的是 210, 211, 212 , 如果正在使用 210为Master(测试方法为访问3台机器的 8161端口, 哪个可以访问,当前哪个是 Master),关闭 210 ,会在 MessageProducer.send 方法时阻塞, 无法正常工作,当210再次启动时, MessageProducer.send方法不再阻塞, 但 Master 可能会变成其他的node,比如 211.

解决办法是参照这里
http://blog.csdn.net/srnpr/article/details/17370813?reload
http://www.cnblogs.com/fuhaots2009/p/3478413.html
这两篇是一样的,不知道谁是原创,都粘贴了.

加上 [b]sync="local_disk"[/b] 参数配置
[quote]
sync

default value: quorum_mem

Controls where updates are reside before being considered complete. This setting is a comma separated list of the following options: local_mem, local_disk, remote_mem, remote_disk, quorum_mem, quorum_disk. If you combine two settings for a target, the stronger guarantee is used. For example, configuring local_mem, local_disk is the same as just using local_disk. quorum_mem is the same as local_mem, remote_mem and quorum_disk is the same as local_disk, remote_disk
[/quote]

详细配置请参见: http://activemq.apache.org/replicated-leveldb-store.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值