最近设置activemq,遇到一个坑,记录下来。
centos7,openjdk1.8, activemq5.11.2
设置自启动是参考了一个设置,具体配置如下
[Unit]
Description=ActiveMQ service
After=network.target
[Service]
WorkingDirectory=/opt/activemq/data
ExecStart=/opt/activemq/bin/activemq start
ExecStop=/opt/activemq/bin/activemq stop
User=root
Group=root
[Install]
WantedBy=multi-user.target
启动之后,无错误消息提示,就被kill掉了。系统log如下
activemq: Connecting to pid: 7208
activemq: INFO: There are no brokers to stop.
activemq: .............................
activemq: INFO: Regular shutdown not successful, sending SIGKILL to process with pid '7208'
systemd: activemq.service: control process exited, code=exited status=1
systemd: Unit activemq.service entered failed state.
systemd: activemq.service failed.
后来换了版本也还是出现同样的状况,试了一晚上也没搞定。
后来看了另一篇,改了一个地方,神奇的居然成功了。