I have 3 replicated machines with Zookeeper and ActiveMQ (linux).
I can confirm that zookeeper works correctly since I can see their ports (2888 and 3888) listening via netstat
. The problem is confirmed in the ActiveMQ side.
On the slave machines, everything seems to work well, since ActiveMQ is not logging any errors or warnings. But in the master machine, the log is different because of an IllegalArgumentException
stacktrace.
This is the error message from activemq.log:
ERROR | Error in thread 'ActiveMQ BrokerService[broker] Task-1'
java.lang.IllegalArgumentException: port out of range:-1
at java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143)[:1.7.0_111]
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:185)[:1.7.0_111]
at org.fusesource.hawtdispatch.transport.TcpTransportServer.<init>(TcpTransportServer.java:52)[hawtdispatch-transport-1.22.jar:1.22]
at org.apache.activemq.leveldb.replicated.MasterLevelDBStore.start_protocol_server(MasterLevelDBStore.scala:134)[activemq-leveldb-store-5.13.4.jar:5.13.4]
at org.apache.activemq.leveldb.replicated.MasterLevelDBStore.doStart(MasterLevelDBStore.scala:111)[activemq-leveldb-store-5.13.4.jar:5.13.4]
at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)[activemq-client-5.13.4.jar:5.13.4]
at org.apache.activemq.leveldb.replicated.ElectingLevelDBStore$$anonfun$start_master$1.apply$mcV$sp(ElectingLevelDBStore.scala:230)[activemq-leveldb-store-5.13.4.jar:5.13.4]
at org.fusesource.hawtdispatch.package$$anon$4.run(hawtdispatch.scala:330)[hawtdispatch-scala-2.11-1.22.jar:1.22]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_111]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_111]
Can someone explain why I'm getting this error and how do I fix it?
Addtional Info: My zookeeper and activemq configs https://gist.github.com/kana0011/3ad1c960b9aa24b8af8d7b623c4cb2b3 (ommitted parts are pretty much left default)
I found out that the problem is the value of
bind
property in thereplicatedLevelDB
bean.The value should be:
tcp://0.0.0.0:0
(port 0)And not:
tcp://0.0.0.0
(no port set)