離線安裝RabbitMQ集群

2021-10-24 20:24:05 字數 3786 閱讀 3227

簡稱約定

192.168.100.138138control-service

192.168.100.139139control-service

192.168.100.140140control-service

每個伺服器均有兩個使用者

root使用者

tsom使用者(普通使用者,根據實際情況而定)

執行:

mkdir soft
openssl-libs-1.0.2k-16.el7.x86_64.rpmopenssl-1.0.2k-16.el7.x86_64.rpmerlang-20.3.8.9-1.el7.centos.x86_64.rpmrabbitmq-server-generic-unix-3.7.3.tar.xz上傳至138/tsom/soft/下。

執行:

mkdir soft
openssl-libs-1.0.2k-16.el7.x86_64.rpmopenssl-1.0.2k-16.el7.x86_64.rpmerlang-20.3.8.9-1.el7.centos.x86_64.rpmrabbitmq-server-generic-unix-3.7.3.tar.xz上傳至139140/tsom/soft/下。

cd /home/tsom/soft
systemctl

stop

firewalld

rpm --force -ivh openssl-libs-1.0.2k-16.el7.x86_64.rpm

rpm --force -ivh openssl-1.0.2k-16.el7.x86_64.rpm

rpm -ivh erlang-20.3.8.9-1.el7.centos.x86_64.rpm

echo

'192.168.100.138 zjtsom-msgqueue01'

>> /etc/hosts

echo

'192.168.100.139 zjtsom-msgqueue02'

>> /etc/hosts

echo

'192.168.100.140 zjtsom-msgqueue03'

>> /etc/hosts

登入138執行以下操作

cd ~/soft
tar -xvf rabbitmq-server-generic-unix-3.7.3.tar.xz

sleep 3

mkdir ~/rabbitmq

mv rabbitmq_server-3.7.3/* ~/rabbitmq

chmod -r +x ~/rabbitmq/sbin/

echo

'export path=$path:/$home/rabbitmq/sbin:$path'

>> ~/.bashrc

source

$home/.bashrc

rabbitmq-server -detached

sleep 10

rabbitmqctl add_user admin abcd1234

rabbitmqctl set_permissions -p / admin ".*"

".*"

".*"

rabbitmqctl set_user_tags admin administrator

rabbitmq-plugins enable rabbitmq_management

rabbitmqctl add_vhost logerror-host

rabbitmqctl set_permissions -p logerror-host admin ".*"

".*"

".*"

rabbitmqctl set_policy -p logerror-host expiry ".*"

集群配置,登入139,140將主機器138的 / tsom /.erlang.cookie 拷貝到另兩台139,

140相同位置,並在139,140執行以下指令碼

cd ~/soft
chmod 600 -r ~/.erlang.cookie

tar -xvf rabbitmq-server-generic-unix-3.7.3.tar.xz

sleep 3

mkdir ~/rabbitmq

mv rabbitmq_server-3.7.3/* ~/rabbitmq

chmod -r +x ~/rabbitmq/sbin/

echo

'export path=$path:/$home/rabbitmq/sbin:$path'

>> ~/.bashrc

source

$home/.bashrc

cd ~/soft

rabbitmq-server -detached

sleep 10

rabbitmqctl add_user admin abcd1234

rabbitmqctl set_permissions -p / admin ".*"

".*"

".*"

rabbitmqctl set_user_tags admin administrator

rabbitmq-plugins enable rabbitmq_management

sleep 3

rabbitmqctl join_cluster rabbit@zjtsom-msgqueue01

驗證

檢視集群狀態:

瀏覽器登入測試

全部使用tsom使用者,確定要先啟動從節點

138,139,140關閉防火牆

systemctl

stop

firewalld

139,140重啟

cd~/

soft

rabbitmq-server

-detached

138重啟

rabbitmq-server

-detached

備註:如果先啟動主節點,要確保以下目錄刪除/home/tsom/rabbitmq/var/lib/rabbitmq/mnesia

離線安裝rabbitmq

erlang和rabbitmq的版本對應關係 安裝socat 選擇centos7的對應版本進行安裝 安裝rabbitmq 上述安裝結束之後,執行命令 chkconfig rabbitmq server on 如果不執行上述命令,直接使用service rabbitmq server start,會產...

離線安裝rabbitmq

rabbitmq安裝主要依賴兩個rpm包,erlang和socat 注意 centos7需要19.3以上版本 erlang 22.1.8 1.el7.x86 64.rpm socat 1.7.3.2 2.el7.x86 64.rpm rabbitmq server 3.8.2 1.el7.noarc...

RabbitMQ離線安裝教程

rabbitmq安裝 1.安裝rabbitmq需要三個軟體包 socat 1.7.3.2 2.el7.x86 64.rpm erlang 19.0.4 1.el7.centos.x86 64.rpm rabbitmq server 3.6.6 1.el7.noarch.rpm 2.安裝軟體包 安裝命...