Ubuntu 12.04 上的 ActiveMQ 报告“未运行”,但它正在运行并监听它的端口...为什么会这样?

Ubuntu 12.04 上的 ActiveMQ 报告“未运行”,但它正在运行并监听它的端口...为什么会这样?

我使用该命令在 Ubuntu 上安装了 ActiveMQ,sudo apt-get install activemq该命令似乎运行良好。

然后,我通过以下命令复制安装提供的示例配置来激活配置:

sudo ln -s /etc/activemq/instances-available/main /etc/activemq/instances-enabled/main

然后我启动了代理:sudo service activemq start

这似乎有效,因为它返回了 OK 并且没有错误。

我可以看到它已启动并监听端口 61616:

administrator@ci-server:~/tmp/Codebase/Build/com.specktro.orchid.build$ netstat -an | grep 61616
tcp6       0      0 127.0.0.1:61616         :::*                    LISTEN     

另外,如果我以调试模式启动它,我可以看到它运行良好:

administrator@ci-server:~/tmp/Codebase/Build/com.specktro.orchid.build$ sudo /etc/init.d/activemq console main
 * Starting with Console ActiveMQ instance  main                                                                                   INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'
INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)
Java Runtime: Oracle Corporation 1.7.0_25 /usr/lib/jvm/java-7-openjdk-amd64/jre
  Heap sizes: current=126720k  free=123924k  max=253440k
    JVM args: -Xms128M -Xmx256M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Dcom.sun.management.jmxremote -Dactivemq.classpath=/var/lib/activemq/main/conf;/etc/activemq/instances-enabled/main; -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/var/lib/activemq/main
ACTIVEMQ_HOME: /usr/share/activemq
ACTIVEMQ_BASE: /var/lib/activemq/main
Loading message broker from: xbean:activemq.xml
 INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@44edb080: startup date [Sun Nov 17 16:03:30 PST 2013]; root of context hierarchy
 INFO | PListStore:/var/lib/activemq/main/data/localhost/tmp_storage started
 INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/var/lib/activemq/main/data/kahadb]
 INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
 INFO | KahaDB is version 3
 INFO | Recovering from the journal ...
 INFO | Recovery replayed 1 operations from the journal in 0.029 seconds.
 INFO | ActiveMQ 5.5.0 JMS Message Broker (localhost) is starting
 INFO | For help or more information please see: http://activemq.apache.org/
 INFO | Listening for connections at: tcp://localhost:61616
 INFO | Connector openwire Started
 INFO | ActiveMQ JMS Message Broker (localhost, ID:ci-server-47748-1384733012178-0:1) started

问题是,当我运行时activemq status,它显示以下消息:

administrator@ci-server:~/tmp/Codebase/Build/com.specktro.orchid.build$ activemq status
INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'
ActiveMQ not running

我有一个检查此命令输出的脚本,但它失败了,因为它期望输出表明它正在运行...我无法更改该脚本。

有谁知道为什么会这样吗?

如果能告诉我为什么 ActiveMQ 似乎正在运行,却报告“未运行”,我将不胜感激!我不知道还要检查什么……

非常感谢!!

爱德华多

答案1

我只是在 Debian Wheezy 上摸索着使用 ActiveMQ。我不明白 apt-get install 版本发生了什么...

不过我已经运行了。我最终选择了 wget。我创建了一个 activemq 用户,并以这个用户的身份运行:wgethttp://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/5.10-SNAPSHOT/apache-activemq-5.10-20140603.133406-78-bin.tar.gz

当我解压时,cd apache-activemq-5.10-SNAPSHOT 然后我运行./bin/activemq start。

还有很多东西需要学习,但我已经学到这么多了。

相关内容