【问题标题】:Activemq will not start on my Ubuntu VMActivemq 不会在我的 Ubuntu 虚拟机上启动
【发布时间】:2012-06-29 04:56:12
【问题描述】:

我正在尝试在我的 ubuntu 虚拟机上运行 activemq,但在启动它时一直遇到问题。我试过下载二进制文件和源代码,但没有成功。目前我已经下载了源码,运行“mvn clean install -Dmaven.test.skip=true”,mvn报告安装成功。然后,我在我的 .m2 文件夹中四处搜寻,找到了 apache-activemq-5.5.1-bin.tar.gz 并将其解压缩到我的 home/USERNAME 目录并尝试运行“bash bin/activemq start”,但收到以下错误。

INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties
 and log4j.properties     
to get details
bin/activemq: line 370: /usr/bin/java -Xms256M -Xmx256M -Dorg.apache.activemq.UseDedicatedTaskRunner=true
 -Djava.util.logging.config.file=logging.properties
 -Dcom.sun.management.jmxremote
 -Dactivemq.classpath="/home/jacob/activeMq1/apache-activemq-5.5.1/conf;"
 -Dactivemq.home="/home/jacob/activeMq1/apache-activemq-5.5.1"  
-Dactivemq.base="/home/jacob/activeMq1/apache-activemq-5.5.1"
-jar "/home/jacob/activeMq1/apache-activemq-5.5.1/bin/run.jar" start >/dev/null 2>&1 & 
 RET="$?"; APID="$!";
 echo $APID > /home/jacob/activeMq1/apache-activemq-5.5.1/data/activemq.pid;
 echo "INFO: pidfile created : '/home/jacob/activeMq1/apache-activemq-5.5.1/data/activemq.pid' (pid '$APID')";
 exit $RET: No such file or directory    

以前有没有人遇到过这种类型的错误?

【问题讨论】:

  • 在这方面做了更多工作。我可以从 bin 文件中运行“java -jar run.jar start”。虽然我很确定单独运行 run.jar 并不是最佳实践。

标签: activemq virtual-machine


【解决方案1】:

看来我又要回答我的一个问题了,但也许这对将来的某个人会有所帮助。

步骤。

  1. 我最终通过运行命令“./bin/activemq setup newConfig”(不包括引号)创建配置文件来让 activemq 工作
  2. 然后我替换了位于 etc/default/ 的当前配置文件“activemq”。 (我在用 newConfig 覆盖之前备份了原始的 activemq 文件)。
  3. 运行“./bin/activemq start”,这将创建一个 PID 文件。
  4. 创建文件后重新运行“./bin/activemq start”以最终启动代理。

然后,您可以通过导航到“http://localhost:8161/admin/”或执行“netstat -an | grep 61616”(如果您保留默认端口等)来测试安装。

【讨论】:

  • 当我尝试 ubuntu 12.04 的 ubuntu 包时,我遇到了同样的错误,并且步骤没有解决它。但是,当使用 tar.gz 版本时,您的步骤完美地解决了这个错误
  • 谢谢!我还使用您的步骤在 ubuntu 13.10 上安装了 ActiveMQ 5.8。
  • 谢谢,它帮助了我们。我们使用 bash 脚本自动下载和安装 Activemq 和可用的服务,无论我们的脚本多么完美,当我们尝试做 vagrant up 并在新创建的实例上运行脚本时,activemq 直到我们去手动输入命令。多亏了这篇文章,我们才明白了原因。
【解决方案2】:

我在Debian上安装activemq 5.13,在/opt下下载解压,然后我去/opt/apache-activemq-5.13.1/run "./bin/activemq start",然后出现这个错误:

xx@debian:/opt/apache-activemq-5.13.1$ ./bin/activemq start
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
./bin/activemq: 330: ./bin/activemq: "/usr/bin/java"  -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/apache-activemq-5.13.1//conf/login.config   -Djava.awt.headless=true -Djava.io.tmpdir="/opt/apache-activemq-5.13.1//tmp"                -Dactivemq.classpath="/opt/apache-activemq-5.13.1//conf:/opt/apache-activemq-5.13.1//../lib/:"               -Dactivemq.home="/opt/apache-activemq-5.13.1/"               -Dactivemq.base="/opt/apache-activemq-5.13.1/"               -Dactivemq.conf="/opt/apache-activemq-5.13.1//conf"               -Dactivemq.data="/opt/apache-activemq-5.13.1//data"                              -jar "/opt/apache-activemq-5.13.1//bin/activemq.jar" start >/dev/null 2>&1 &
          RET="$?"; APID="$!";
          echo $APID > /opt/apache-activemq-5.13.1//data/activemq.pid;
          echo "INFO: pidfile created : '/opt/apache-activemq-5.13.1//data/activemq.pid' (pid '$APID')";exit $RET: not found

我所做的是使用“uname -a”检查 Debian 版本:

Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

我发现我的 debian 是 64 位系统。所以我跑了

./bin/linux-x86-64/activemq start

它显示:

Starting ActiveMQ Broker...

然后我可以使用用户名“admin”和密码“admin”访问该站点:http://localhost:8161/admin/

【讨论】:

  • 谢谢。它帮助了我
【解决方案3】:

对于 Ubuntu 14.04,我必须在 /etc/activemq/instances-enabled 中创建一个链接

sudo ln -s ../instances-available/main/

类似于 apache2 的设置

然后用/etc/init.d/activemq start启动服务器

【讨论】:

  • 在 ubuntu 18.04 中,它适用于以下命令 sudo /etc/init.d/activemq start
【解决方案4】:

sudo 是必要的。

bin$ sudo ./activemq 开始

bin$ sudo ./activemq 状态 信息:正在加载 '/opt/runtime/apache-activemq-5.11.1/bin/env' 信息:使用 java '/usr/bin/java' ActiveMQ 正在运行(pid '29887')

【讨论】:

  • 如果您有定义ACTIVEMQ_USER/etc/default/activemq,则必须以root 身份启动脚本。所以确实,要么使用sudo,要么删除/etc/default/activemq
  • 当 user=activemq 在 active-mq.service 时遇到了完全相同的问题。将其替换为root,一切从现在开始。谢谢。
猜你喜欢
  • 2017-08-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-14
  • 1970-01-01
  • 2013-03-28
  • 1970-01-01
  • 2023-03-25
相关资源
最近更新 更多