$ docker-compose up Attaching to activemq_activemq-B_1, activemq_activemq-A_1 activemq-B_1 | INFO: Using default configuration activemq-B_1 | (you can configure options in one of these file: /etc/default/activemq /root/.activemqrc) activemq-B_1 | activemq-B_1 | INFO: Invoke the following command to create a configuration file activemq-B_1 | /usr/local/apache-activemq-5.8.0/bin/activemq setup [ /etc/default/activemq | /root/.activemqrc ] activemq-B_1 | activemq-A_1 | INFO: Using default configuration activemq-A_1 | (you can configure options in one of these file: /etc/default/activemq /root/.activemqrc) activemq-A_1 | activemq-A_1 | INFO: Invoke the following command to create a configuration file activemq-B_1 | INFO: Using java '/usr/local/jdk1.8.0_144/bin/java' activemq-A_1 | /usr/local/apache-activemq-5.8.0/bin/activemq setup [ /etc/default/activemq | /root/.activemqrc ] activemq-A_1 | activemq-B_1 | INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C) activemq-A_1 | INFO: Using java '/usr/local/jdk1.8.0_144/bin/java' activemq-A_1 | INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C) activemq-B_1 | Java Runtime: Oracle Corporation 1.8.0_144 /usr/local/jdk1.8.0_144/jre activemq-B_1 | Heap sizes: current=1005056k free=989327k max=1005056k activemq-B_1 | JVM args: -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Dcom.sun.management.jmxremote -Djava.io.tmpdir=/usr/local/apache-activemq-5.8.0/tmp -Dactivemq.classpath=/usr/local/apache-activemq-5.8.0/conf; -Dactivemq.home=/usr/local/apache-activemq-5.8.0 -Dactivemq.base=/usr/local/apache-activemq-5.8.0 -Dactivemq.conf=/usr/local/apache-activemq-5.8.0/conf -Dactivemq.data=/usr/local/apache-activemq-5.8.0/data activemq-B_1 | Extensions classpath: activemq-B_1 | [/usr/local/apache-activemq-5.8.0/lib,/usr/local/apache-activemq-5.8.0/lib/camel,/usr/local/apache-activemq-5.8.0/lib/optional,/usr/local/apache-activemq-5.8.0/lib/web,/usr/local/apache-activemq-5.8.0/lib/extra] activemq-B_1 | ACTIVEMQ_HOME: /usr/local/apache-activemq-5.8.0 activemq-B_1 | ACTIVEMQ_BASE: /usr/local/apache-activemq-5.8.0 activemq-B_1 | ACTIVEMQ_CONF: /usr/local/apache-activemq-5.8.0/conf activemq-B_1 | ACTIVEMQ_DATA: /usr/local/apache-activemq-5.8.0/data activemq-A_1 | Java Runtime: Oracle Corporation 1.8.0_144 /usr/local/jdk1.8.0_144/jre activemq-A_1 | Heap sizes: current=1005056k free=989327k max=1005056k activemq-A_1 | JVM args: -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Dcom.sun.management.jmxremote -Djava.io.tmpdir=/usr/local/apache-activemq-5.8.0/tmp -Dactivemq.classpath=/usr/local/apache-activemq-5.8.0/conf; -Dactivemq.home=/usr/local/apache-activemq-5.8.0 -Dactivemq.base=/usr/local/apache-activemq-5.8.0 -Dactivemq.conf=/usr/local/apache-activemq-5.8.0/conf -Dactivemq.data=/usr/local/apache-activemq-5.8.0/data activemq-A_1 | Extensions classpath: activemq-A_1 | [/usr/local/apache-activemq-5.8.0/lib,/usr/local/apache-activemq-5.8.0/lib/camel,/usr/local/apache-activemq-5.8.0/lib/optional,/usr/local/apache-activemq-5.8.0/lib/web,/usr/local/apache-activemq-5.8.0/lib/extra] activemq-A_1 | ACTIVEMQ_HOME: /usr/local/apache-activemq-5.8.0 activemq-A_1 | ACTIVEMQ_BASE: /usr/local/apache-activemq-5.8.0 activemq-A_1 | ACTIVEMQ_CONF: /usr/local/apache-activemq-5.8.0/conf activemq-A_1 | ACTIVEMQ_DATA: /usr/local/apache-activemq-5.8.0/data activemq-B_1 | Loading message broker from: xbean:activemq.xml activemq-A_1 | Loading message broker from: xbean:activemq.xml activemq-B_1 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@68c4039c: startup date [Wed Sep 07 13:16:20 UTC 2022]; root of context hierarchy activemq-A_1 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@68c4039c: startup date [Wed Sep 07 13:16:20 UTC 2022]; root of context hierarchy activemq-B_1 | INFO | PListStore:[/usr/local/apache-activemq-5.8.0/data/localhost/tmp_storage] started activemq-B_1 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.8.0/data/kahadb] activemq-A_1 | INFO | PListStore:[/usr/local/apache-activemq-5.8.0/data/localhost/tmp_storage] started activemq-A_1 | INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/local/apache-activemq-5.8.0/data/kahadb] activemq-A_1 | INFO | Database /usr/local/apache-activemq-5.8.0/data/kahadb/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: File '/usr/local/apache-activemq-5.8.0/data/kahadb/lock' could not be locked. activemq-B_1 | INFO | KahaDB is version 4 activemq-B_1 | INFO | Recovering from the journal ... activemq-B_1 | INFO | Recovery replayed 1 operations from the journal in 0.022 seconds. activemq-B_1 | INFO | Apache ActiveMQ 5.8.0 (localhost, ID:activemq-B-41795-1662556582026-0:1) is starting activemq-B_1 | INFO | Listening for connections at: tcp://activemq-B:61616?maximumConnections=1000&wireformat.maxFrameSize=104857600 activemq-B_1 | INFO | Connector openwire Started activemq-B_1 | INFO | Listening for connections at: amqp://activemq-B:5672?maximumConnections=1000&wireformat.maxFrameSize=104857600 activemq-B_1 | INFO | Connector amqp Started activemq-B_1 | INFO | Listening for connections at: stomp://activemq-B:61612?transport.closeAsync=false activemq-B_1 | INFO | Connector stomp Started activemq-B_1 | INFO | Listening for connections at: stomp+nio://activemq-B:61613?transport.closeAsync=false activemq-B_1 | INFO | Connector stomp+nio Started activemq-B_1 | INFO | Apache ActiveMQ 5.8.0 (localhost, ID:activemq-B-41795-1662556582026-0:1) started activemq-B_1 | INFO | For help or more information please see: http://activemq.apache.org activemq-B_1 | ERROR | Temporary Store limit is 51200 mb, whilst the temporary data directory: /usr/local/apache-activemq-5.8.0/data/localhost/tmp_storage only has 42398 mb of usable space activemq-B_1 | INFO | Web console type: embedded activemq-B_1 | INFO | ActiveMQ WebConsole initialized. activemq-B_1 | INFO | Initializing Spring FrameworkServlet 'dispatcher' activemq-B_1 | INFO | jolokia-agent: No access restrictor found at classpath:/jolokia-access.xml, access to all MBeans is allowed activemq-A_1 | INFO | Database /usr/local/apache-activemq-5.8.0/data/kahadb/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: File '/usr/local/apache-activemq-5.8.0/data/kahadb/lock' could not be locked.
根据启动的顺序不同,A、B 都有可能抢到锁对外提供服务,未抢到锁的实例日志一直会报无法解锁的错误,同时不会对外提供 Web Console 服务。使用 Python 的连接例子,发现 stomp.py 有一个问题不能很好的支持 failover。