时间:2021-11-25来源:www.pcxitongcheng.com作者:电脑系统城
1.在/etc/init.d 目录下新建一个 rabbitmq
1 | [root@localhost init.d]# vi rabbitmq |
文件内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
#!/bin/bash #chkconfig:2345 61 61 export HOME=/opt/data/rabbitmq/ export PATH=$PATH:/usr/local/erlang/bin export PATH=$PATH:/usr/local/src/rabbitmq_server-3.6.15/sbin case "$1" in start) echo "Starting RabbitMQ ..." rabbitmq-server -detached ;; stop) echo "Stopping RabbitMQ ..." rabbitmqctl stop ;; status) echo "Status RabbitMQ ..." rabbitmqctl status ;; restart) echo "Restarting RabbitMQ ..." rabbitmqctl stop rabbitmq-server restart ;; *) echo "Usage: $prog {start|stop|status|restart}" ;; esac exit 0 |
2.对rabbitmq授予可执行权限
1 | [root@localhost init.d]# chmod 777 rabbitmq |
3. 添加rabbitmq服务到系统服务中
1 | [root@localhost init.d]# chkconfig --add rabbitmq |
4.设置自启动
1 | [root@localhost init.d]# chkconfig rabbitmq on |
5.查看自启动项是否设置成功
1 | [root@localhost init.d]# chkconfig --list rabbitmq |
6.开启rabbit服务
1 | [root@localhost init.d]# ./rabbitmq start |
7.测试开机重启
1 2 |
[root@localhost init.d]#reboot [root@localhost ~]# ps -elf|grep rabbitmq |
以上就是本文的全部内容,希望对大家的学习有所帮助
2023-03-17
Nginx主机域名配置实现2023-03-17
Nginx配置-日志格式配置方式2023-03-17
Apache APISIX Dashboard 未授权访问漏洞分析(CVE-2021-45232)正常项目无法访问(Linux 服务器),启动tomcat时卡在下图位置,项目无法启动。1、先检查tomcat日志、项目日志没有报错信息,且没再产生新的日志信息。2、jdk、tomcat 、 jvm 配置,服...
2023-03-15
这篇文章主要介绍了Kubernetes中Nginx服务启动失败排查流程(Error: ImagePullBackOff),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以...
2023-03-15