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 rabbit@mq-71 
rabbitmqctl start_app


Hostname mismatch: node "rabbit@rabbitmq70" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@rabbitmq70"

# 先把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












软件包下载地址:https://download.csdn.net/download/zwhfyy/10676362

后一篇有nginx集群设置

你可能感兴趣的:(rabbitMq)