About | FAQ | Help
Ask Your Question

Could not connect to ActiveMQ Server - activemq for mcollective failing

asked 2014-11-04 13:31:45 -0500

tek0011 gravatar image

I am trying to get mcollective running. Having issues with activemq.

Here is it restarting, seems fine:

[root@puppet activemq]# service activemq restart
INFO: Loading '/etc/sysconfig/activemq'
INFO: Using java 'java'
INFO: Loading '/etc/sysconfig/activemq'
INFO: Using java 'java'
INFO: changing to user 'activemq' to invoke java
INFO: Waiting at least 30 seconds for regular process termination of pid '12430' :
Java Runtime: Oracle Corporation 1.7.0_71 /usr/lib/jvm/java-1.7.0-openjdk-
  Heap sizes: current=506816k  free=504020k  max=506816k
    JVM args: -Xms512m -Xmx512m -Djava.util.logging.config.file=logging.properties -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal -Djava.security.auth.login.config=/etc/activemq/login.config -Dactivemq.classpath=/etc/activemq; -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/usr/share/activemq -Dactivemq.conf=/etc/activemq -Dactivemq.data=/usr/share/activemq/data
Extensions classpath:
ACTIVEMQ_HOME: /usr/share/activemq
ACTIVEMQ_BASE: /usr/share/activemq
ACTIVEMQ_CONF: /etc/activemq
ACTIVEMQ_DATA: /usr/share/activemq/data
Connecting to pid: 12430
.Stopping broker: localhost
INFO: Loading '/etc/sysconfig/activemq'
INFO: Using java 'java'
activemq not running
INFO: Loading '/etc/sysconfig/activemq'
INFO: Using java 'java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: changing to user 'activemq' to invoke java
INFO: pidfile created : '/var/run/activemq/activemq.pid' (pid '12774')
INFO: Loading '/etc/sysconfig/activemq'
INFO: Using java 'java'
activemq is running (pid '12774')

However when I attempt to run mco ping -v it doesnt respond, so when I stop it it comes back with the following error:

[root@puppet activemq]# mco ping -v
The ping application failed to run: Could not connect to ActiveMQ Server:

Could not connect to ActiveMQ Server:  (RuntimeError)
        from /usr/libexec/mcollective/mcollective/connector/activemq.rb:248:in `connect'  <----
        from /usr/lib/ruby/site_ruby/1.8/mcollective/client.rb:18:in `initialize'
        from /usr/libexec/mcollective/mcollective/application/ping.rb:52:in `new'
        from /usr/libexec/mcollective/mcollective/application/ping.rb:52:in `main'
        from /usr/lib/ruby/site_ruby/1.8/mcollective/application.rb:291:in `run'
        from /usr/lib/ruby/site_ruby/1.8/mcollective/applications.rb:23:in `run'
        from /usr/bin/mco:24

Here are my configs:


[root@puppet activemq]# cat activemq.xml
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
  http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">

      For more information about what MCollective requires ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-06 10:00:07 -0500

tek0011 gravatar image

I was able to resolve this by the following:

ensure activemq is owner and has access to /var/log/activemq and all sub dirs.

ensure /etc/init.d/activemq has: ACTIVEMQ_CONFIGS="/etc/sysconfig/activemq"

create file activemq in /etc/sysconfig if it doesnt exist.

add this line: ACTIVEMQ_DATA="/var/log/activemq/activemq-data/localhost/KahaDB"

The problem was that activeMQ 5.9.x was using /usr/share/activemq as its KahaDB location.

edit flag offensive delete link more


Im running activemq 5.13.0 installed in /opt. The init file basically points to /etc/init.d/activemqstart.sh and /etc/init.d/activemqstop.sh and those just run /opt/activemq/bin/activemq [start|stop]. The logs and the kahadb files are all under /opt/activemq/data/ all owned by activemq.activemq.

James P Dehnert Sr gravatar imageJames P Dehnert Sr ( 2016-03-03 13:49:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-11-04 13:31:45 -0500

Seen: 2,469 times

Last updated: Nov 06 '14