1. 程式人生 > >rabbitmq解除安裝安裝命令總結,以及遇到的坑

rabbitmq解除安裝安裝命令總結,以及遇到的坑

/sbin/service rabbitmq-server start
檢視有哪些quences
sudo rabbitmqctl list_queues


-------------解除安裝
/sbin/service rabbitmq-server stop
yum list | grep rabbitmq
yum -y remove rabbitmq-server.noarch

yum list | grep erlang
yum -y remove erlang-*
yum remove erlang.x86_64 
rm -rf /usr/lib64/erlang
rm -rf /var/lib/rabbitmq

-------------停止防火牆   #停止firewall   #禁止firewall開機啟動
systemctl stop firewalld.service 
systemctl disable firewalld.service

vi /etc/hosts 
192.168.31.71   mq-71
192.168.31.72   mq-72
 
echo mq-71> /etc/hostname
echo mq-72> /etc/hostname



--------------rpm 安裝
安裝Erlang前,需要先安裝socat
 

rpm -ivh erlang-21.0.9-1.el7.centos.x86_64.rpm
rpm -ivh   socat-1.7.3.2-2.el7.x86_64.rpm
rpm -ivh  rabbitmq-server-3.7.7-1.el7.noarch.rpm
chkconfig rabbitmq-server on
/sbin/service rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
rabbitmqctl add_user admin 123456
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p "/" admin "." "." ".*"

scp 
[email protected]
:/var/lib/rabbitmq/.erlang.cookie /var/lib/rabbitmq/ chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie //或者開啟埠 firewall-cmd --permanent --add-port=15672/tcp firewall-cmd --permanent --add-port=4369/tcp firewall-cmd --reload //關閉防火牆 systemctl stop firewalld.service rabbitmqctl change_password Username Newpassword rabbitmqctl change_password admin 123456 vi /etc/hosts 192.168.31.71 mq-71 192.168.31.72 mq-72 192.168.31.73 mq-73 192.168.31.74 mq-74 echo mq-71> /etc/hostname echo mq-72> /etc/hostname echo mq-73> /etc/hostname echo mq-74> /etc/hostname chmod 777 /var/lib/rabbitmq/.erlang.cookie vi /var/lib/rabbitmq/.erlang.cookie chmod 400 /var/lib/rabbitmq/.erlang.cookie /sbin/service rabbitmq-server stop rabbitmqctl stop rabbitmq-server -detached rabbitmqctl stop_app (主節點不執行這個 rabbitmqctl start_app) rabbitmqctl join_cluster
[email protected]
rabbitmqctl start_app Hostname mismatch: node "[email protected]" believes its host is different. Please ensure that hostnames resolve the same way locally and on "[email protected]" # 先把rabbitmq程序殺掉 $ ps -ef | grep rabbitmq | grep -v grep | awk '{print $2}' | xargs kill -9 # 設定hostname(假設主機ip為:192.168.1.1,主機名設為:mq) $ echo 192.168.1.1 mq > /etc/hosts $ echo rabbitmq > /etc/hostname $ export HOSTNAME=mq # 重啟rabbitmq $ rabbitmq-server -detached # 開啟web socket服務 $ rabbitmq-plugins enable rabbitmq_management rabbitmq_web_stomp # 設定使用者並給予管理員許可權 $ rabbitmqctl add_user duni duni $ rabbitmqctl set_user_tags duni administrator # 設定使用者目錄 $ rabbitmqctl set_permissions -p / duni ".*" ".*" ".*" 降級安裝 3.7.7-1 /usr/lib64/ socat 依賴於其他的包 警告:socat-2.0.0-0.b9.5.mga7.x86_64.rpm: 頭V3 RSA/SHA1 Signature, 金鑰 ID 80420f66: NOKEY 錯誤:依賴檢測失敗: libcrypto.so.1.1()(64bit) 被 socat-2.0.0-0.b9.5.mga7.x86_64 需要 libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) 被 socat-2.0.0-0.b9.5.mga7.x86_64 需要 libreadline.so.7()(64bit) 被 socat-2.0.0-0.b9.5.mga7.x86_64 需要 libssl.so.1.1()(64bit) 被 socat-2.0.0-0.b9.5.mga7.x86_64 需要 libssl.so.1.1(OPENSSL_1_1_0)(64bit) 被 socat-2.0.0-0.b9.5.mga7.x86_64 需要 yum install openssl-libs-1.0.2k-12.el7.x86_64.rpm yum install readline-6.2-10.el7.x86_64.rpm

後一篇有nginx叢集設定