activemq failover using multiple instances in master slave mode on same linux machine -
i have setup activemq mulitple instances achieve failover in master slave mode in windows. while setting same created 3 instances under bin folder without changing port , started 3 instances 1 one. first instance became master , remaining in slave mode until stopped master instance.
now trying achieve same in linux environment. first instance starts when start second instance in different window throws below error:
error | failed start apache activemq ([instance2, id:132vm6-57227-1478597606120-0:1], java.io.ioexception: transport connector not registered in jmx: java.io.ioexception: failed bind server socket: tcp://0.0.0.0:61616?maximumconnections=1000&wireformat.maxframesize=104857600 due to: java.net.bindexception: address in use) info | apache activemq 5.14.0 (instance2, id:132vm6-57227-1478597606120-0:1) shutting down info | connector openwire stopped info | connector amqp stopped info | connector stomp stopped info | connector mqtt stopped info | connector ws stopped info | pliststore:[/opt/apache-activemq-5.14.0/bin/instance2/data/instance2/tmp_storage] stopped info | stopping async queue tasks info | stopping async topic tasks info | stopped kahadb info | apache activemq 5.14.0 (instance2, id:132vm6-57227-1478597606120-0:1) uptime 0.585 seconds info | apache activemq 5.14.0 (instance2, id:132vm6-57227-1478597606120-0:1) shutdown info | closing org.apache.activemq.xbean.xbeanbrokerfactory$1@4233871a: startup date [tue nov 08 15:03:24 ist 2016]; root of context hierarchy warn | exception thrown lifecycleprocessor on context close java.lang.illegalstateexception: lifecycleprocessor not initialized - call 'refresh' before invoking lifecycle methods via context: org.apache.activemq.xbean.xbeanbrokerfactory$1@4233871a: startup date [tue nov 08 15:03:24 ist 2016]; root of context hierarchy @ org.springframework.context.support.abstractapplicationcontext.getlifecycleprocessor(abstractapplicationcontext.java:357)[spring-context-4.1.9.release.jar:4.1.9.release] @ org.springframework.context.support.abstractapplicationcontext.doclose(abstractapplicationcontext.java:884)[spring-context-4.1.9.release.jar:4.1.9.release] @ org.springframework.context.support.abstractapplicationcontext.close(abstractapplicationcontext.java:843)[spring-context-4.1.9.release.jar:4.1.9.release] @ org.apache.activemq.hooks.springcontexthook.run(springcontexthook.java:30)[activemq-spring-5.14.0.jar:5.14.0] @ org.apache.activemq.broker.brokerservice.stop(brokerservice.java:875)[activemq-broker-5.14.0.jar:5.14.0] @ org.apache.activemq.xbean.xbeanbrokerservice.stop(xbeanbrokerservice.java:122)[activemq-spring-5.14.0.jar:5.14.0] @ org.apache.activemq.broker.brokerservice.start(brokerservice.java:629)[activemq-broker-5.14.0.jar:5.14.0] @ org.apache.activemq.xbean.xbeanbrokerservice.afterpropertiesset(xbeanbrokerservice.java:73)[activemq-spring-5.14.0.jar:5.14.0] @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)[:1.7.0_65] @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)[:1.7.0_65] @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)[:1.7.0_65] @ java.lang.reflect.method.invoke(method.java:606)[:1.7.0_65]
i using activemq 5.14 version. if has encountered similar issue, kindly provide inputs.
to multiple instances of activemq running on same machine, need change ports try open. there (at least) 3 ports need changed:
- the
transportconnector
ports accept messaging traffic. these defined in theactivemq.xml
file. typically needopenwire
1 - 61616 default; change in other activemq instances 61626, 61636 etc. can comment out others if don't intend use them. - the jetty http port. defined in
jetty.xml
file. default 8161, set next ones 8162, 8163 etc. the jmx port. one's bit tricky, need stick piece of config
activemq.xml
explicitly define follows:<managementcontext> <managementcontext createconnector="true" connectorport="1099"/> </managementcontext>
you can change 1199, 1299 on other instances. hope helps.
Comments
Post a Comment