I have two activemq instances on the same machine. One running on all the default port settings and the other one on the following ports:
Changed to the second activemq instance:
<managementContext createConnector="true" connectorPort="1100" jmxDomainName="broker2"/>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61617"/>
<property name="port" value="8162" />
So when I execute bin/activemq start:
INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1100/jmxrmi
INFO | Listening for connections at: tcp://myhostname:61617
When I try to stop it, bin/activemq stop:
INFO: There are no brokers to stop.
INFO: Regular shutdown not successful, sending SIGKILL to process with pid '26137'
I added some logging to the script to discover that it was doing this call:
/usr/bin/java -Dactivemq.classpath="/home/myuser/activeMQ2/apache-activemq-5.4.1/conf;" -Dactivemq.home="/home/myuser/activeMQ2/apache-activemq-5.4.1" -Dactivemq.base="/home/myuser/activeMQ2/apache-activemq-5.4.1" -jar "/home/myuser/activeMQ2/apache-activemq-5.4.1/bin/run.jar" stop --jmxurl service:jmx:rmi:///jndi/rmi://localhost:1100/jmxrmi
This doesn't seem to find the JMX service in the specified location, even though it is the URL that was printed at start up (See log above).
All I wanted to have is two instances running on the same box to test a cluster configuration, but starting/stopping them correctly with the scripts seem to be a pain. A simple kill to the process PID works much better.