阿里雲服務centOS7下安裝rabbitmq

2021-08-31 01:25:36 字數 2608 閱讀 9535

環境:

centos:  7.4;阿里雲伺服器

erlang :18.3;

rabbitmq :rabbitmq-server-generic-unix-3.6.15

參考:1、erlang與centos,rabbitmq與erlang,這些都是有依賴關係的,不同版本會存在不相容性。

2、rabbitmq官方給出的與erlang/otp的版本相容要求:    

step1安裝erlang;這個鏈結安裝的是18.3的erlang

ø wget

ø rpm -uvh erlang-solutions-1.0-1.noarch.rpm

ø rpm -import

ø yum install erlang

成功介面截圖()

驗證是否成功

v wget

v xz -d rabbitmq-server-generic-unix-3.6.15.tar.xz

v tar xvf rabbitmq-server-generic-unix-3.6.15.tar

####將解壓後的rabbitmq_server-3.6.15移動到/usr/loca目錄下,

v sudo mv rabbitmq_server-3.6.15/ /usr/local/rabbitmq

step3設定環境變數

第一種方式:臨時變數,在shell視窗中執行下面的命令即可

export path=$path:/usr/local/rabbitmq/sbin

第二種方式:持久變數,需要更改/etc/profile檔案,在該檔案最後新增export path=$path:/usr/local/rabbitmq/sbin,然後退出編輯,是/etc/profile檔案生效

##編輯  profile 檔案

vi /etc/profile

#使編輯後的profile檔案生效

source /etc/profile

step4啟動rabbitmq

進入/usr/local/rabbitmq/sbin目錄,執行rabbitmq-server 出現如下資訊就說明已經啟動了

rabbitmq-server -detatched 以守護程序方式啟動

rabbitmq-server在當前session中啟動,當session過期後,會關閉rabbitmq

異常記錄:

-bash-4.2$ rabbitmq-server

/usr/local/rabbitmq/sbin/rabbitmq-server: line 51: /usr/local/rabbitmq/var/lib/rabbitmq/mnesia/[email protected]: permission denied

failed to write pid file: /usr/local/rabbitmq/var/lib/rabbitmq/mnesia/[email protected]

-bash-4.2$ sudo ./rabbitmq-server

[sudo] password for ddps:

boot failed

error description:

noproc

log files (may contain more information):

/usr/local/rabbitmq/var/log/rabbitmq/[email protected]

/usr/local/rabbitmq/var/log/rabbitmq/[email protected]

stack trace:

[,]},

,]},

,]},

,]},

,]},,]

=info report==== 10-jul-2018::09:39:00.860378 ===

error description:

noproc

log files (may contain more information):

/usr/local/rabbitmq/var/log/rabbitmq/[email protected]

/usr/local/rabbitmq/var/log/rabbitmq/[email protected]

stack trace:

[,]},

,]},

,]},

,]},

,]},,]

init terminating in do_boot (noproc)

crash dump is being written to: erl_crash.dump...done

-bash-4.2$

原因:許可權問題

從上面的方法可以看出,先是用普通賬戶啟動的,但是報:rabbit@**.pid: permission denied;然後又用sudo方式啟動,結果還是失敗,報error description: noproc錯誤;

之後使用root賬戶,能啟動,然後檢視日誌檔案,發現許可權有問題,擁有者是root

阿里雲Centos7下安裝Mongodb

wgettar zxvf mongodb linux x86 64 rhel70 3.2.4.tgz解壓完成後 然後將它移動到usr local下面 mv mongodb linux x86 64 rhel70 3.2.4 usr local mongodb然後建立資料庫目錄 cd usr loca...

阿里雲 Centos7 安裝zookeeper

1 建立 usr local zookeeper 資料夾 shell mkdir p usr local zookeeper2 進入到 usr local zookeeper 目錄中 shell wget htps 4 解壓縮 zookeeper 3.5.4 beta.tar.gz shell ta...

阿里雲centos7 安裝mysql

wget sudo rpm ivh mysql community release el7 5.noarch.rpm 安裝 yum install mysql server yum install mysql devel yum install mysql rpm qa grep i mysql 啟...