上傳離線安裝包 到指定資料夾 執行
rpm -ivh *.rpm
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
# centos7 用這個
cat <<EOF > /etc/yum.repos.d/rabbitmq.repo
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1
EOF
# centos6 用這個
cat <<EOF > /etc/yum.repos.d/rabbitmq.repo
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/6/
gpgcheck=0
repo_gpgcheck=0
enabled=1
EOF
yum makecache
yum install socat
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v21.3.8.12/erlang-21.3.8.12-1.el7.x86_64.rpm
rpm -ivh erlang-21.3.8.12-1.el7.x86_64.rpm --force --nodeps
yum install rabbitmq-server
# 設定服務,開機自動啓動
systemctl enable rabbitmq-server
# 啓動服務
systemctl start rabbitmq-server
# 重新啓動
systemctl restart rabbitmq-server
# 開啓管理介面外掛
rabbitmq-plugins enable rabbitmq_management
# 防火牆開啓 15672 管理埠
firewall-cmd --zone=public --add-port=15672/tcp --permanent
firewall-cmd --reload
存取伺服器的15672埠,例如:http://192.168.126.155:15672
# 新增使用者
rabbitmqctl add_user admin admin
# 新使用者設定使用者爲超級管理員
rabbitmqctl set_user_tags admin administrator
新增許可權 自行登錄 伺服器頁面設定
# 開啓用戶端連線埠
firewall-cmd --zone=public --add-port=5672/tcp --permanent
firewall-cmd --reload