Linux centos7 install and uninstall rabbitMQ and stepped pit

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/LuuvyJune/article/details/90516891

First prepare linux environment, create a new folder software in / usr / local. Here QuickStart Installation rpm choose to install, relatively simple in this way, it is necessary to prepare these gcc and so what, because some plug-ins will be less easy installation.

First, install

1, ready

(If this process can not download, you need to check with the network through)

yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc xz

2, the required installation package download rabbitmq

wget www.rabbitmq.com/releases/erlang/erlang-18.3-1.el7.centos.x86_64.rpm
wget http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.rpm
wget www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-3.6.5-1.noarch.rpm

 

3, installation, erlang order to install the environment and install socat, RabbitMQ final installation, as there is a dependency between them.

rpm -ivh erlang-18.3-1.el7.centos.x86_64.rpm
rpm -ivh socat-1.7.3.2-5.el7.lux.x86_64.rpm
rpm -ivh rabbitmq-server-3.6.5-1.noarch.rpm 

4, the configuration and hosts hostname

vim /etc/hosts 

192.168.2.81 mq81
192.168.2.82 mq82
192.168.2.83 mq83

--修改主机名
vim /etc/hostname

5, turn off the firewall

----停止防火墙 #停止firewall  #禁止firewall开机启动
systemctl stop firewalld.service 
systemctl disable firewalld.service

6, the configuration file: for example, change passwords, configuration, and so on.

[root@mq81 software]# vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin/rabbit.app

After opening the file as follows: loopback_users in << "guest" >>, leaving only guest 

7, start the service:

rabbitmq-server start &

Look at the process:

ps -ef | grep rabbit

View Services: 

lsof -i:5672

 

8, the management plug-in:

rabbitmq-plugins enable rabbitmq_management

9, browser access: http://192.168.2.203:15672/  user name and password here are the guest 

Second, the problems encountered during installation 

1, the installation process encountered a problem, modifying rabbitmq.app file, Novice accidentally deleted something, leading to the start time the same error, the error can be seen from this document is missing some code:

Try collected from the online copy, but it is difficult to find a complete, well thought unloading heavy equipment, look at the way the uninstall process.

rabbitmq uninstall:

(1), delete rabbitmq: 

--卸载
--停止服务
rabbitmqctl app_stop
yum list | grep rabbitmq
yum -y remove rabbitmq-server.noarch

 

(2) Delete erlang:

yum list | grep erlang
yum -y remove erlang-*
yum remove erlang.x86_64

(3) delete the lib file:

[root@mq81 ~]# rm -rf /usr/lib64/erlang 
[root@mq81 ~]# rm -rf /var/lib/rabbitmq

2, start the service reported: ERROR: epmd error for host mq81: address (can not connect to host / port)

Solution:

vim /etc/rabbitmq/rbitmq-env.conf

Add NODENAME = rabbit @ mq81

mq81 is the host name

3、还有一种服务启动时,提示已在某主机上启动占用,node with name  "rabbit" already running on xxx

这种时候需要 ps -ef | grep rabbit 查看一下进程,然后将关于mq的一些关键进程杀死,这样才可以重新启动。

Guess you like

Origin blog.csdn.net/LuuvyJune/article/details/90516891