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!

Community
  • 1
  • 1

3 Answers3

3

Rather that installing ActiveMQ through apt-get, it's actually much easier to download a copy as a tar.gz and extract it into /opt. There are instructions for getting it running as a Unix service - it's the easiest approach for managing installations.

I generally also create a symbolic link /opt/activemq to the directory containing the ActiveMQ version in use, that I use for configuring the service. That way to upgrade, all you need to do is repoint the link to the new version.

Jakub Korab
  • 4,974
  • 2
  • 24
  • 34
  • Thanks for the fast response! Actually, i am installing ActiveMQ via a puppet module. The installation works well and i guess that puppet internally uses apt-get, because the installation looks the same and i get the same errors. Since I am trying to solve this with puppet, I can not make use of the tar.gz installation :/ Anyway, thanks for the symlink hint, I'll keep that in mind! Regards, Andreas – Andreas Schraitle Jun 20 '13 at 12:53
1

Ok, I solved it my own. It seems that the ActiveMQ apt repo content is broken. Since I am using puppet, I rely on a package manager. Therefore, I switched to the AWS Linux AMI, which uses yum by default. Unfortunatly there is no ActiveMQ package repo, so you have to create a new .repo file (sudo nano /etc/yum.repos.d/activemq.repo) and add the following:

[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 

Regards, Andreas

1

It is because the activemq user is not the owner of the directories in which the activemq pid file is to kept. change to the directory which has your files - chown -R activemq:users apache-activemq-

Rajat Sud
  • 11
  • 1