centos搭建activemq5.16

下载jdk、activemq(我这里都放在在/usr/local)之后。。。

/usr/local/activemq/bin/目录下有一个env文件添加JAVA_HOME

注意activemq.xml里面不能出现中文,注释也不行

接下来在/usr/lib/systemd/system/创建activemq.service文件

powershell 复制代码
# 单元节段的开始标记
[Unit]
# 服务的描述信息
Description=Description=ActiveMQ service
# 定义服务在网络目标、远程文件系统目标和域名解析服务目标完成后启动
After=network.target remote-fs.target nss-lookup.target
# 服务配置节段的开始标记
[Service]
# 定义服务类型为 forking,表示服务以分叉模式运行
Type=forking
# 定义服务启动命令
ExecStart=/usr/local/activemq/bin/activemq start
# 定义服务重新加载命令
ExecReload=/usr/local/activemq/bin/activemq restart
# 定义服务停止命令
ExecStop=/usr/local/activemq/bin/activemq stop
# 安装配置节段的开始标记
[Install]
# 指定服务将被安装到 multi-user.target 的依赖关系中,这使得该服务可以在多用户模式下启动
WantedBy=multi-user.target

重载systemctl daemon-reload

启动systemctl start activemq.service

停止systemctl stop activemq.service

重启systemctl restart activemq.service

查看状态systemctl status activemq.service

加入开机自启systemctl enable activemq.service

取消开机启动systemctl disable activemq.service

检测是否开启成功 systemctl list-unit-files | grep activemq

网络工具查看netstat -lnp|grep java,没安装的话执行yum -y install net-tools
注意:启动失败可以看/usr/local/activemq/data/里面的log日志分析

相关推荐
悄悄敲敲敲6 分钟前
Linux:进程间通信->共享内存
linux·运维·服务器
绵绵细雨中的乡音14 分钟前
Linux进程学习【环境变量】&&进程优先级
linux·运维·学习
天下·第二25 分钟前
【Nginx】负载均衡配置详解
运维·nginx·负载均衡
GanGuaGua1 小时前
linux:进程的替换
linux·运维·服务器
蓝易云1 小时前
在Linux、CentOS7中设置shell脚本开机自启动服务
前端·后端·centos
梓䈑2 小时前
【Linux系统】详解Linux权限
linux·运维·bash
小茬粥2 小时前
kvm网卡发现的采集信息脚本COLT_CMDB_KVM_NETDISC.sh
linux·kvm
Mr_sun.2 小时前
Day23-Web开发——Linux
linux·运维·服务器
星雨流星天的笔记本2 小时前
1、Linux操作系统下,ubuntu22.04版本切换中英文界面
linux·学习
极小狐2 小时前
如何创建并使用极狐GitLab 部署令牌?
运维·git·ssh·gitlab·github