RabbitMq 在centos中開機自啟動

2022-02-16 13:59:48 字數 1359 閱讀 9702

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

[root@localhost init.d]# vi rabbitmq

檔案內容

#!/bin/bash

#chkconfig:

2345

6161

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

"instart)

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 ";;

esac

exit

0

2.對rabbitmq授予可執行許可權

[root@localhost init.d]# chmod

777 rabbitmq

3. 新增rabbitmq服務到系統服務中

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

4.設定自啟動

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

5.檢視自啟動項是否設定成功

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

6.開啟rabbit服務

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

7.測試開機重啟

[root@localhost init.d]#reboot

[root@localhost ~]# ps -elf|grep rabbitmq

在CentOS7上安裝RabbitMQ

首先需要安裝erlang,參考 安裝過程中會有提示,一路輸入 y 即可。完成後安裝rabbitmq yum install rabbitmq server 3.6.6 1.el7.noarch.rpm完成後啟動服務 service rabbitmq server start可以檢視服務狀態 這裡可以...

在CentOS7上安裝RabbitMQ

1.安裝erlang rpm uvh yum install erlang如果出現 error failed dependencies epel release is needed by erlang solutions 1.0 1.noarch表示阿里雲已配置erlang solutions 1....

RabbitMQ在CentOS上的簡單安裝配置

1.依賴erlang,yum install erlang安裝之 1.啟用web管理頁面 rabbitmq plugins enable rabbitmq management 2.啟動rabbitmq service rabbitmq server start 3.新增防火牆策略 允許5672 r...