ActiveMQ CentOS 7

257 views
Skip to first unread message

Opencast-Newbie

unread,
Nov 23, 2015, 4:56:48 PM11/23/15
to Matterhorn Users
I'm trying to make ActiveMQ start with the system. I tried this command-line.

systemctl start activemq.service

When i restart the computer, activemq doesn't run.


Any Idea why?

Thanks

Maximiliano Lira Del Canto

unread,
Nov 23, 2015, 5:13:43 PM11/23/15
to Matterhorn Users
Hi I have the same problem here, activemq as service "starts" but not working.

If you use "/bin/activemq start" works


Why activemq as a service doesn't works?

Maximiliano Lira Del Canto
Estudiante Ingeniería Civil Telemática UTFSM
Teléfono: +569-89198850
Viña del Mar, Chile

--
You received this message because you are subscribed to the Google Groups "Matterhorn Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to matterhorn-use...@opencast.org.

Mikey Orr

unread,
Nov 23, 2015, 5:19:13 PM11/23/15
to matterho...@opencast.org
You'll need to "enable" the service in addition to starting it (it doesn't matter which order you enable/start a service):

bash# systemctl enable activemq

This is basically the systemd version of 'chkconfig', which would control the init.d files. The other sub-command that you might want to know is 'status':

bash# systemctl status activemq
activemq.service
   Loaded: loaded (/etc/rc.d/init.d/activemq)
   Active: active (exited) since Mon 2015-11-09 18:26:56 PST; 1 weeks 6 days ago
  Process: 2186 ExecStart=/etc/rc.d/init.d/activemq start (code=exited, status=0/SUCCESS)

That should show you the service is both loaded and active. At that point, it should survive a reboot. =)

-Mikey


--
Mikey Orr
Learning Technologies Mac/Unix Systems Integrator
ITS @ University of California, Santa Cruz

Opencast-Newbie

unread,
Nov 24, 2015, 8:53:05 AM11/24/15
to Matterhorn Users
Okay. I kinda solved the problem.

My problem was that i starte activemq for the first time as a root. The service starts as user: activemq. Well my the activemq user can't acess the log files and other files, because its not root. So i changed the file owner from root to activemq, and then it worked.


With:
systemctl status activemq ... Its showes its active and running

But with

activemq status

it says its not running.

It seems to be running.. but i have to investigate more.

Opencast-Newbie

unread,
Nov 24, 2015, 8:56:22 AM11/24/15
to Matterhorn Users
I have dont that, and fixed some other problems.

"systemctl enable activemq " tells me its running, but "activemq status" says its not.

Any idea why?




On Monday, November 23, 2015 at 11:19:13 PM UTC+1, Mikey Orr wrote:

Mikey Orr

unread,
Nov 24, 2015, 12:30:04 PM11/24/15
to matterho...@opencast.org
Do you have an ActiveMQ process actually running?

bash$ ps -ef | grep activemq
activemq  2260     1  0 Nov09 ?        00:38:26 java -Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/srv/activemq/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/srv/activemq/tmp -Dactivemq.classpath=/srv/activemq/conf: -Dactivemq.home=/srv/activemq -Dactivemq.base=/srv/activemq -Dactivemq.conf=/srv/activemq/conf -Dactivemq.data=/srv/activemq/data -jar /srv/activemq/bin/activemq.jar start

If so, try going to the admin page for ActiveMQ via your web browser (you may need to open some firewall rules):

http://your-activemq-host:8161 or

If it's not running, make sure you copied the activemq.xml file to the right place, as mentioned in the docs: http://docs.opencast.org/latest/admin/configuration/message-broker/

Give that a shot and see what happens. =)

-Mikey


Max Lira

unread,
Nov 24, 2015, 2:02:04 PM11/24/15
to Matterhorn Users
Can sombebody post the contents of the archive activemq.service?
 
I mess up this file and I need to restore to the original version

My file is in this state:
[Unit]
Description=Messaging and Integration Patterns provider
After=local-fs.target
After=network.target

[Service]
Type=forking
ExecStart=/usr/share/activemq/bin/activemq start >/dev/null 2>&1
ExecStop=/usr/share/activemq/bin/activemq stop >/dev/null 2>&1
#ExecStart=/bin/activemq console
User=activemq
Group=activemq

[Install]
WantedBy=multi-user.target



The file is located in /usr/lib/systemd/system

Regards

Lars Kiesow

unread,
Nov 24, 2015, 4:43:15 PM11/24/15
to matterho...@opencast.org
Hi Max,
you can find prepared RPM packages for CentOS here:
https://copr.fedoraproject.org/coprs/lkiesow/apache-activemq-dist/
These include a Systemd unit files.
–Lars
Reply all
Reply to author
Forward
0 new messages