欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

centos開機自動啟動RabbitMq軟件的方法

 更新時間:2021年11月25日 08:58:01   作者:chester.chen  
本文詳細(xì)講解了centos開機自動啟動RabbitMq軟件的方法,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以收藏下

1.在/etc/init.d 目錄下新建一個 rabbitmq

[root@localhost init.d]# vi rabbitmq

文件內(nèi)容

#!/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授予可執(zhí)行權(quán)限

[root@localhost init.d]# chmod 777 rabbitmq

3. 添加rabbitmq服務(wù)到系統(tǒng)服務(wù)中

[root@localhost init.d]# chkconfig --add rabbitmq

4.設(shè)置自啟動

[root@localhost init.d]# chkconfig rabbitmq on

5.查看自啟動項是否設(shè)置成功

[root@localhost init.d]# chkconfig --list rabbitmq

6.開啟rabbit服務(wù)

[root@localhost init.d]# ./rabbitmq start

?7.測試開機重啟

[root@localhost init.d]#reboot
[root@localhost ~]# ps -elf|grep rabbitmq

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論