Activemq集群+zookeeper集群+leveldb,主备切换很慢,有时还超时

activemq集群一共就3个节点,zookeeper也3个节点
手动停止当前的Mater activemq节点,大概要10秒才能连接到其他的节点,这好像也太慢了
其中一次consumer因为连不上超时退出了,生产者倒是一直等到连接成功
还有出现一次zookeeper超时,然后生产者和消费者连接activemq节点全部超时
但我在zookeeper上看状态是正常的(后来zookeeper集群自动恢复了,不过是好几分钟之后的事情)
连接就是用的failover
failover:(tcp://192.168.0.21:61616,tcp://192.168.0.22:61616,tcp://192.168.0.23:61616)?randomize=true

 WARN | Transport (tcp://192.168.0.23:61616) failed , attempting to automatically reconnect: {}
java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:392)
    at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
    at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:240)
    at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:232)
    at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
    at java.lang.Thread.run(Thread.java:745)
    

然后就卡这里了

这大概是哪里出问题了? 而且只是测试,没什么数据,机器的资源占用也不高

我这是少配了什么?

 <persistenceAdapter>
            <replicatedLevelDB
                   directory = "${activemq.data}/leveldb"
                   replicas="3"
                   bind="tcp://0.0.0.0:61613"
                   zkAddress="192.168.0.113:2181,192.168.0.114:2181,192.168.0.115:2181"
                   hostname="192.168.0.21"
                   zkPath="/activemq/levedb-stores"
                   />
        </persistenceAdapter>

生产者和消费者我没注册到zookeeper中去

另外:配置文件中的${activemq.data}/leveldb
The directory which the store will use to hold it's data files. The store will create the directory if it does not already exist.
按照官网的解释(虽然已经过时了)应该会自动创建,为什么我找不到这个目录?
是在/opt/activemq/data这个目录下?

阅读 3.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进