Since the previously built version is too low, there are many vulnerabilities that need to be fixed. Therefore need to upgrade to the latest version 3.8.2
Previous link:
https://www.cnblogs.com/xiao987334176/p/12303664.html
Operating system | ip | hostname | configuration |
---|---|---|---|
centos 6.9 | 192.168.31.7 | mq_01 | 1 core 2g |
centos 6.9 | 192.168.31.216 | mq_02 | 1 core 2g |
centos 6.9 | 192.168.31.214 | mq_03 | 1 core 2g |
Log in to the mq background, click Export definitions to export the data. The data file is json
mq_01 execution
mkdir -p /data/software/rabbitmq_update
cd /data/software/rabbitmq_update
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-3.8.2-1.el6.noarch.rpm
Copy files to 2 other servers
mq_01 execution
scp -P 22-r rabbitmq_update 192.168.31.216:/data/software/
scp -P 22-r rabbitmq_update 192.168.31.214:/data/software/
3 Run it on both servers
/etc/init.d/rabbitmq-server stop
yum remove -y rabbitmq-server erlang*
rm -rf /var/lib/rabbitmq/*
rm -rf /data/rabbitmq/mnesia/*
rm -rf /usr/lib64/erlang
rm -rf /var/lib/rabbitmq
3 Run it on both servers
yum install -y wget
cd /data/software/rabbitmq_update
rpm -ivh erlang-solutions-1.0-1.noarch.rpm
Change erlang's yum source and change yum source to domestic Tsinghua's yum source
vim /etc/yum.repos.d/erlang_solutions.repo
The content is as follows:
[ erlang-solutions]
name=Centos $releasever - $basearch - Erlang Solutions
# baseurl=http://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch
baseurl=https://mirrors4.tuna.tsinghua.edu.cn/erlang-solutions/centos/6/
gpgcheck=1
# gpgkey=http://packages.erlang-solutions.com/debian/erlang_solutions.asc
gpgkey=http://packages.erlang-solutions.com/rpm/erlang_solutions.asc
enabled=1
3 Run it on both servers
yum -y install erlang
yum clean all
3 Run it on both servers
rpm -ivh rabbitmq-server-3.8.2-1.el6.noarch.rpm
cd /etc/rabbitmq/
mv rabbitmq.conf rabbitmq.config
/etc/init.d/rabbitmq-server start
The other 2 hosts copy the first cookie
Log in to mq_02, execute mq_03
scp -P 27192.168.10.184:/var/lib/rabbitmq/.erlang.cookie /var/lib/rabbitmq/
chown -R rabbitmq.rabbitmq /var/lib/rabbitmq/.erlang.cookie
chmod 600/var/lib/rabbitmq/.erlang.cookie
3 Install it
rabbitmq-plugins enable rabbitmq_management
3 Run it all
rabbitmqctl add_user admin 'admin123'
rabbitmqctl set_permissions -p / admin ...
rabbitmqctl set_user_tags admin administrator
The other 2 nodes are added to the first
Log in to mq_02, mq_03 node, first close, join, and finally start
rabbitmqctl stop_app
rabbitmqctl join_cluster --ram rabbit@mq_01
rabbitmqctl start_app
Log in to any node to view
rabbitmqctl cluster_status
Visit the mq background, if rabbitmq ReferenceError: disable_stats is not defined
appears in the upper left corner
Wait a few minutes, refresh it
After logging in, click on Import definitions
Select the json file, click Upload broker definitions
to start importing.
Finally, the developer will test whether the production and consumption are normal.
Reference link for this article:
https://www.cnblogs.com/wangkaiok/p/11942855.html
https://blog.csdn.net/bushcat2015/article/details/88627969
https://www.jianshu.com/p/83acc90c2792
Recommended Posts