2

I've installed ActiveMQ on an EC2-Ubuntu instance (Ubuntu Server 13.04)(via apt) Yet, I face the problem that I can not start ActiveMQ via the provided start script.

When I try to start it - as the default 'ubuntu' user - i get the following error:

ubuntu@ip-..-154-186-78:/etc/default$ /usr/bin/activemq start
INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
mkdir: missing operand
Try 'mkdir --help' for more information.
/usr/bin/activemq: 373: /usr/bin/activemq: /usr/bin/java -Xms512M -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true  -Dcom.sun.management.jmxremote  -Djava.io.tmpdir="/var/lib/activemq/tmp" -Dactivemq.classpath="/var/lib/activemq/conf;" -Dactivemq.home="/usr/share/activemq" -Dactivemq.base="/var/lib/activemq/" -Dactivemq.conf="/var/lib/activemq/conf" -Dactivemq.data="/var/lib/activemq/data" -jar "/usr/share/activemq/bin/run.jar" start >/dev/null 2>&1 &
          RET="$?"; APID="$!";
          echo $APID > /var/run/activemq.pid;
          echo "INFO: pidfile created : '/var/run/activemq.pid' (pid '$APID')";exit $RET: not found

When I try to start it - using sudo - I get the following error:

ubuntu@ip-..-154-186-78:/etc/default$ sudo /usr/bin/activemq start
INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: changing to user 'activemq' to invoke java
mkdir: missing operand
Try 'mkdir --help' for more information.
-su: line 2: /var/run/activemq.pid: Permission denied
INFO: pidfile created : '/var/run/activemq.pid' (pid '10166')

Running '#/usr/bin/activemq status' tells me:

ubuntu@ip-..-154-186-78:/etc/default$ /usr/bin/activemq status
INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/bin/java'
ActiveMQ not running

I already tried to create a new config and to replace it - as suggested here: Activemq will not start on my Ubuntu VM

Any suggestions what the problem could be ?

Thanks in advance!

4

3 回答 3

3

apt-get与其通过. _ _ tar.gz_ /opt有关于让它作为 Unix 服务运行的说明——这是管理安装的最简单方法。

我通常还会创建一个指向/opt/activemq包含正在使用的 ActiveMQ 版本的目录的符号链接,用于配置服务。这种升级方式,您需要做的就是将链接重新指向新版本。

于 2013-06-20T09:16:27.423 回答
1

好的,我自己解决了。似乎 ActiveMQ apt repo 内容已损坏。由于我使用的是 puppet,所以我依赖包管理器。因此,我切换到默认使用 yum 的 AWS Linux AMI。不幸的是没有 ActiveMQ 包 repo,所以你必须创建一个新的 .repo 文件(sudo nano /etc/yum.repos.d/activemq.repo)并添加以下内容:

[activemq-centos]
name=activemq-centos
failovermethod=priority
baseurl=http://packages.platform14.net/repo/activemq/centos/5/$basearch/
enabled=1
gpgcheck=0

[activemq-source]
name=activemq-source
failovermethod=priority
baseurl=http://packages.platform14.net/repo/activemq/centos/5/SRPMS/
enabled=1
gpgcheck=0 

问候, 安德烈亚斯

于 2013-06-25T18:44:44.377 回答
1

这是因为 activemq 用户不是要保存 activemq pid 文件的目录的所有者。切换到包含您的文件的目录 - chown -R activemq:users apache-activemq-

于 2016-02-01T13:04:55.803 回答