6

I have followed a tutorial to install ActiveMQ http://servicebus.blogspot.com/2011/02/installing-apache-active-mq-on-ubuntu.html

I dont quite understand this part of the tutorial

Now, you must create the data/jmx.password and data/jmx.access files

How should I work this out?

I tried running the service by

sudo /etc/init.d/activemq start

and I get this response

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
INFO: changing to user 'activemq' to invoke java
No directory, logging in with HOME=/
INFO: pidfile created : '/opt/activemq/data/activemq-iandjx-GA-MA785GMT-USB3.pid' (pid 
'6092')

but I'm still unable to connect to

http://localhost:8161

Thanks in advance.

I also tried sudo apt-get install activemq then

activemq

which gave me

INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/lib/jvm/java-6-openjdk//bin/java'
mkdir: missing operand
Try `mkdir --help' for more information.
/usr/bin/activemq: 399: /usr/bin/activemq: /usr/lib/jvm/java-6-openjdk//bin/java -Xms512M -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true                -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" : not found
Tasks provided by the sysv init script:
    restart         - stop running instance (if there is one), start new instance
    console         - start broker in foreground, useful for debugging purposes
    status          - check if activemq process is running
    setup           - create the specified configuration file for this init script
                      (see next usage section)

Configuration of this script:
    The configuration of this script can be placed on /etc/default/activemq or /home/iandjx/.activemqrc.
    To use additional configurations for running multiple instances on the same operating system
    rename or symlink script to a name matching to activemq-instance-<INSTANCENAME>.
    This changes the configuration location to /etc/default/activemq-instance-<INSTANCENAME> and
    $HOME/.activemqrc-instance-<INSTANCENAME>. Configuration files in /etc have higher precedence.
fardown
  • 713
  • 2
  • 12
  • 23

5 Answers5

2

to start the server in interactive mode, go to /bin and run ./activemq console

Ben ODay
  • 20,784
  • 9
  • 45
  • 68
1

activemq start

should work for starting it.

activemq status

should tell if the service is running or not.

It may be possible that you have to run once to create the PID file, and then re-run to make it work, as describer in this answer: Activemq will not start on my Ubuntu VM

In case it is running and you just can't connect to the web console, check this other Q/A: ActiveMQ console not available

Community
  • 1
  • 1
Thomas
  • 2,751
  • 5
  • 31
  • 52
1

Check /etc/default/activemq for this line and note the username and password:

ACTIVEMQ_SUNJMX_CONTROL="--jmxurl service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/j
mxrmi --jmxuser USERNAME --jmxpassword PASSWORD"

Your jmx.password file should contain the username/password pair

USERNAME PASSWORD

Your jmx.access file should contain the username followed by readwrite

USERNAME readwrite
Spektr
  • 865
  • 1
  • 7
  • 7
0

sudo is necessary.

bin$ sudo ./activemq start
bin$ sudo ./activemq status
INFO: Loading '/opt/runtime/apache-activemq-5.11.1/bin/env'
INFO: Using java '/usr/bin/java'
ActiveMQ is running (pid '29887')
Nilesh
  • 20,521
  • 16
  • 92
  • 148
0

open file vim /etc/default/activemq and comment line #ACTIVEMQ_USER="activemq"

now go to bin folder in apache-activemq and run it by using command ./activemq start

Shubham kapoor
  • 394
  • 3
  • 18