You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by asookazian <as...@gmail.com> on 2014/07/29 00:47:07 UTC
starting two instances of ActiveMQ on same machine with kahadb
master/slave
I am using AMQ 5.9.1.
I have been following this blog for setting up a master/slave AMQ cluster on
same machine using same kahadb for persistence:
http://akuntamukkala.blogspot.com/2013/07/using-activemq-masterslave.html
<http://akuntamukkala.blogspot.com/2013/07/using-activemq-masterslave.html>
On OS X, I am able to start either broker-1 or broker-2 but not both on OS
X.
I have checked that the ports in use are 61616 and 61626 for broker-1 and
broker-2, respectively, using the following cmds:
netstat -a | grep 61616
netstat -a | grep 61626
So I know as a result that the correct activemq.xml files are being parsed
for bother brokers. What am I missing? I am seeing the following
consistently when i start the 2nd broker (or the 1st broker if broker-2 is
already running):
NextGates-MacBook-Pro:bin arbisookazian$ ./broker-2 start
Starting ActiveMQ Broker...
ActiveMQ Broker is already running.
I have the following in broker-1 script:
export
ACTIVEMQ_HOME=/Users/arbisookazian/sw/activemq/master-slave-failover/apache-activemq-5.9.1
export ACTIVEMQ_BASE=$ACTIVEMQ_HOME/cluster/*broker-1*
export ACTIVEMQ_CONF=$ACTIVEMQ_BASE/conf
${ACTIVEMQ_HOME}/bin/macosx/activemq "$@"
I have the following in broker-2 script:
export
ACTIVEMQ_HOME=/Users/arbisookazian/sw/activemq/master-slave-failover/apache-activemq-5.9.1
export ACTIVEMQ_BASE=$ACTIVEMQ_HOME/cluster/*broker-2*
export ACTIVEMQ_CONF=$ACTIVEMQ_BASE/conf
${ACTIVEMQ_HOME}/bin/macosx/activemq "$@"
I have the following in activemq.xml for broker-1:
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://0.0.0.0:<b>61616*?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
I have the following in activemq.xml for broker-2:
<transportConnectors>
<transportConnector name="openwire"
uri="tcp://0.0.0.0:<b>61626*?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
</transportConnectors>
I doesn't seem to make a difference if I remove the comments above or not.
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
I have the following for broker-1 in conf/activemq.xml:
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker-2"
dataDirectory="${activemq.data}" useJmx="true">
...
<managementContext>
<managementContext createConnector="true" connectorPort="1099"/>
</managementContext>
...
</broker>
I tried to connect via JDK 7 jconsole to remote process:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
assuming not password protected and that fails to connect.
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683833.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
So it seems there are two problems:
1) setting the JAVA_OPTS correctly using failover transport syntax
2) unable to read 'brokerName' via JMX
any ideas on these two?
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683831.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
Simplified to the following:
NextGates-MacBook-Pro:bin arbisookazian$ export
JAVA_OPTS="-Dwebconsole.type=properties
-Dwebconsole.jms.url=tcp://localhost:61616
-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
NextGates-MacBook-Pro:bin arbisookazian$ echo $JAVA_OPTS
-Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://localhost:61616
-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
Now seeing this in the log:
SEVERE: Servlet.service() for servlet [jsp] in context with path
[/activemq-web-console-5.8.0] threw exception [javax.el.ELException: Error
reading 'brokerName' on type org.apache.activemq.web.RemoteJMXBrokerFacade]
with root cause
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:147)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:341)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at
com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:114)
at
com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:203)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at
javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1936)
at
javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1903)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:286)
at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
at
org.apache.activemq.web.RemoteJMXBrokerFacade.createConnection(RemoteJMXBrokerFacade.java:146)
at
org.apache.activemq.web.RemoteJMXBrokerFacade.getMBeanServerConnection(RemoteJMXBrokerFacade.java:114)
at
org.apache.activemq.web.RemoteJMXBrokerFacade.getBrokerAdmin(RemoteJMXBrokerFacade.java:88)
at
org.apache.activemq.web.RemoteJMXBrokerFacade.getBrokerName(RemoteJMXBrokerFacade.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:99)
at
org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:183)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:84)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:102)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683830.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
NextGates-MacBook-Pro:bin arbisookazian$ export
JAVA_OPTS=-Dwebconsole.type=properties
-Dwebconsole.jms.url="failover:(tcp://localhost:61616,tcp://localhost:61626)"
-Dwebconsole.jmx.url="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi,service:jmx:rmi:///jndi/rmi://localhost:2099/jmxrmi"
-bash: export:
`-Dwebconsole.jms.url=failover:(tcp://localhost:61616,tcp://localhost:61626)':
not a valid identifier
-bash: export:
`-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi,service:jmx:rmi:///jndi/rmi://localhost:2099/jmxrmi':
not a valid identifier
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683829.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
setting on command line myself now rather than in the .sh script itself:
NextGates-MacBook-Pro:bin arbisookazian$ echo $JAVA_OPTS
-Dwebconsole.type=properties
-Dwebconsole.jms.url=failover:(tcp://localhost:61616,tcp://localhost:61626)
-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi,service:jmx:rmi:///jndi/rmi://localhost:2099/jmxrmi
NextGates-MacBook-Pro:bin arbisookazian$ ./catalina.sh run
Using CATALINA_BASE:
/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54
Using CATALINA_HOME:
/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54
Using CATALINA_TMPDIR:
/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/temp
Using JRE_HOME:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
Using CLASSPATH:
/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/bin/bootstrap.jar:/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/bin/tomcat-juli.jar
./catalina.sh: eval: line 324: syntax error near unexpected token `('
./catalina.sh: eval: line 324: `exec
"/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java"
"-Djava.util.logging.config.file=/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/conf/logging.properties"
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Dwebconsole.type=properties
-Dwebconsole.jms.url=failover:(tcp://localhost:61616,tcp://localhost:61626)
-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi,service:jmx:rmi:///jndi/rmi://localhost:2099/jmxrmi
-Djava.endorsed.dirs="/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/endorsed"
-classpath
"/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/bin/bootstrap.jar:/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/bin/tomcat-juli.jar"
-Dcatalina.base="/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54"
-Dcatalina.home="/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54"
-Djava.io.tmpdir="/Users/arbisookazian/sw/activemq/master-slave-failover/apache-tomcat-7.0.54/temp"
org.apache.catalina.startup.Bootstrap start'
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683828.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
JAVA_OPTS=-Dwebconsole.type=properties
-Dwebconsole.jms.url="tcp://localhost:61616"
-Dwebconsole.jmx.url="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
same behavior...
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683827.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
tried this as well (removed /'s after jmx:rmi):
JAVA_OPTS=-Dwebconsole.type=properties
-Dwebconsole.jms.url="failover:(tcp://localhost:61616,tcp://localhost:61626)"
-Dwebconsole.jmx.url="service:jmx:rmi://jndi/rmi://localhost:1099/jmxrmi,service:jmx:rmi://jndi/rmi://localhost:2099/jmxrmi"
same behavior
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683824.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
Ok made some progress with 5.8.0 AMQ. I am able to bring up both
nodes/brokers (one master who attains the kahadb lock first and one slave).
I deploy the activemq-web-console-5.8.0.war to tomcat-7.0.54 and the app
starts up successfully at:
http://localhost:8080/activemq-web-console-5.8.0/index.jsp
The problem is that the broker name is "web-console" where it should be
"broker-1" or "broker-2". When I produce messages using the producer
client, the messages are showing up on in the TEST.FOO queue for
web-console.
Any idea how to show the queues for master/slave only (not web-console)?
This is critical in bin/catalina.sh:
JAVA_OPTS=-Dwebconsole.type=properties
-Dwebconsole.jms.url="failover:(tcp://localhost:61616,tcp://localhost:61626)"
-Dwebconsole.jmx.url="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi,service:jmx:rmi:///jndi/rmi://localhost:2099/jmxrmi"
And it looks like JAVA_OPTS is not being over-written anywhere in that
script. Any help appreciated. thx.
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683823.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
reproducing with AMQ 5.8.0.
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683798.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: starting two instances of ActiveMQ on same machine with kahadb
master/slave
Posted by asookazian <as...@gmail.com>.
I do not see the keyword 'lock' in either activemq.log file at INFO level
logging.
The blog states the following:
"Start broker-2.
You will observe that broker-2 is unable to acquire the lock since broker-1
already grabbed it. broker-2 will keep retrying to acquire the lock every 10
seconds."
--
View this message in context: http://activemq.2283324.n4.nabble.com/starting-two-instances-of-ActiveMQ-on-same-machine-with-kahadb-master-slave-tp4683769p4683793.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.