Install RabbitMQ on CentOS7

Introduction to RabbitMQ##

**RabbitMQ is an open source message broker software (also known as message-oriented middleware) that implements the advanced Message Queuing protocol (AMQP). The RabbitMQ server is written in Erlang language, and the cluster and failover are built on the Open Telecom Platform framework. All major programming languages have client libraries that communicate with the agent interface. **

1. Single machine deployment#

1. Install erlang

1.1.* Create erlang.repo library*

[ root@VM_147_130_centos ~]# curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
Detected operating system as centos/7.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/rabbitmq/erlang/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures...
Loaded plugins: fastestmirror, langpacks
rabbitmq_erlang-source/signature                                                                                                                         |  819 B  00:00:00     
Retrieving key from https://packagecloud.io/rabbitmq/erlang/gpgkey
Importing GPG key 0xDF309A0B:
 Userid     :"https://packagecloud.io/rabbitmq/erlang (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: 2ebd e413 d3ce 5d35 bcd1 5b7c 71c6 3471 df30 9a0b
 From       : https://packagecloud.io/rabbitmq/erlang/gpgkey
rabbitmq_erlang-source/signature                                                                                                                         |  951 B  00:00:00 !!! 
rabbitmq_erlang-source/primary                                                                                                                           |  175 B  00:00:02     
Loading mirror speeds from cached hostfile
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
- - > Running transaction check
- - - > Package yum-utils.noarch 0:1.1.31-34.el7 will be updated
- - - > Package yum-utils.noarch 0:1.1.31-50.el7 will be an update
- - > Processing Dependency: yum >= 3.4.3-143 for package: yum-utils-1.1.31-50.el7.noarch
- - > Running transaction check
- - - > Package yum.noarch 0:3.4.3-132.el7.centos.0.1 will be updated
- - - > Package yum.noarch 0:3.4.3-161.el7.centos will be an update
- - > Processing Dependency: rpm >= 4.11.3-22 for package: yum-3.4.3-161.el7.centos.noarch
- - > Processing Dependency: python-urlgrabber >= 3.10-8 for package: yum-3.4.3-161.el7.centos.noarch
- - > Running transaction check
- - - > Package python-urlgrabber.noarch 0:3.10-7.el7 will be updated
- - - > Package python-urlgrabber.noarch 0:3.10-9.el7 will be an update
- - - > Package rpm.x86_64 0:4.11.3-17.el7 will be updated
- - > Processing Dependency: rpm = 4.11.3-17.el7 for package: rpm-libs-4.11.3-17.el7.x86_64
- - > Processing Dependency: rpm = 4.11.3-17.el7 for package: rpm-python-4.11.3-17.el7.x86_64
- - - > Package rpm.x86_64 0:4.11.3-35.el7 will be an update
- - > Running transaction check
- - - > Package rpm-libs.x86_64 0:4.11.3-17.el7 will be updated
- - > Processing Dependency: rpm-libs(x86-64)= 4.11.3-17.el7 for package: rpm-build-libs-4.11.3-17.el7.x86_64
- - - > Package rpm-libs.x86_64 0:4.11.3-35.el7 will be an update
- - - > Package rpm-python.x86_64 0:4.11.3-17.el7 will be updated
- - - > Package rpm-python.x86_64 0:4.11.3-35.el7 will be an update
- - > Running transaction check
- - - > Package rpm-build-libs.x86_64 0:4.11.3-17.el7 will be updated
- - - > Package rpm-build-libs.x86_64 0:4.11.3-35.el7 will be an update
- - > Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================
 Package                                         Arch                                 Version                                            Repository                        Size
================================================================================================================================================================================
Updating:
 yum-utils                                       noarch                               1.1.31-50.el7                                      os                               121 k
Updating for dependencies:
 python-urlgrabber                               noarch                               3.10-9.el7                                         os                               108 k
 rpm                                             x86_64                               4.11.3-35.el7                                      os                               1.2 M
 rpm-build-libs                                  x86_64                               4.11.3-35.el7                                      os                               106 k
 rpm-libs                                        x86_64                               4.11.3-35.el7                                      os                               277 k
 rpm-python                                      x86_64                               4.11.3-35.el7                                      os                                83 k
 yum                                             noarch                               3.4.3-161.el7.centos                               os                               1.2 M

Transaction Summary
================================================================================================================================================================================
Upgrade  1 Package (+6 Dependent packages)

Total download size: 3.1 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1 /7): python-urlgrabber-3.10-9.el7.noarch.rpm                                                                                                           | 108 kB  00:00:00     
(2 /7): rpm-build-libs-4.11.3-35.el7.x86_64.rpm                                                                                                           | 106 kB  00:00:00     
(3 /7): rpm-libs-4.11.3-35.el7.x86_64.rpm                                                                                                                 | 277 kB  00:00:00     
(4 /7): rpm-python-4.11.3-35.el7.x86_64.rpm                                                                                                               |  83 kB  00:00:00     
(5 /7): rpm-4.11.3-35.el7.x86_64.rpm                                                                                                                      | 1.2 MB  00:00:00     
(6 /7): yum-utils-1.1.31-50.el7.noarch.rpm                                                                                                                | 121 kB  00:00:00     
(7 /7): yum-3.4.3-161.el7.centos.noarch.rpm                                                                                                               | 1.2 MB  00:00:00     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                           9.2 MB/s | 3.1 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Updating   : rpm-4.11.3-35.el7.x86_64                                                                                                                                    1/14 
 Updating   : rpm-libs-4.11.3-35.el7.x86_64                                                                                                                               2/14 
 Updating   : rpm-build-libs-4.11.3-35.el7.x86_64                                                                                                                         3/14 
 Updating   : rpm-python-4.11.3-35.el7.x86_64                                                                                                                             4/14 
 Updating   : python-urlgrabber-3.10-9.el7.noarch                                                                                                                         5/14 
 Updating   : yum-3.4.3-161.el7.centos.noarch                                                                                                                             6/14 
 Updating   : yum-utils-1.1.31-50.el7.noarch                                                                                                                              7/14 
 Cleanup    : yum-utils-1.1.31-34.el7.noarch                                                                                                                              8/14 
 Cleanup    : yum-3.4.3-132.el7.centos.0.1.noarch                                                                                                                         9/14 
 Cleanup    : rpm-python-4.11.3-17.el7.x86_64                                                                                                                            10/14 
 Cleanup    : python-urlgrabber-3.10-7.el7.noarch                                                                                                                        11/14 
 Cleanup    : rpm-build-libs-4.11.3-17.el7.x86_64                                                                                                                        12/14 
 Cleanup    : rpm-4.11.3-17.el7.x86_64                                                                                                                                   13/14 
 Cleanup    : rpm-libs-4.11.3-17.el7.x86_64                                                                                                                              14/14 
 Verifying  : python-urlgrabber-3.10-9.el7.noarch                                                                                                                         1/14 
 Verifying  : rpm-libs-4.11.3-35.el7.x86_64                                                                                                                               2/14 
 Verifying  : rpm-python-4.11.3-35.el7.x86_64                                                                                                                             3/14 
 Verifying  : yum-utils-1.1.31-50.el7.noarch                                                                                                                              4/14 
 Verifying  : rpm-4.11.3-35.el7.x86_64                                                                                                                                    5/14 
 Verifying  : yum-3.4.3-161.el7.centos.noarch                                                                                                                             6/14 
 Verifying  : rpm-build-libs-4.11.3-35.el7.x86_64                                                                                                                         7/14 
 Verifying  : yum-utils-1.1.31-34.el7.noarch                                                                                                                              8/14 
 Verifying  : rpm-libs-4.11.3-17.el7.x86_64                                                                                                                               9/14 
 Verifying  : rpm-4.11.3-17.el7.x86_64                                                                                                                                   10/14 
 Verifying  : rpm-build-libs-4.11.3-17.el7.x86_64                                                                                                                        11/14 
 Verifying  : yum-3.4.3-132.el7.centos.0.1.noarch                                                                                                                        12/14 
 Verifying  : rpm-python-4.11.3-17.el7.x86_64                                                                                                                            13/14 
 Verifying  : python-urlgrabber-3.10-7.el7.noarch                                                                                                                        14/14 

Updated:
 yum-utils.noarch 0:1.1.31-50.el7                                                                                                                                              

Dependency Updated:
 python-urlgrabber.noarch 0:3.10-9.el7  rpm.x86_64 0:4.11.3-35.el7  rpm-build-libs.x86_64 0:4.11.3-35.el7  rpm-libs.x86_64 0:4.11.3-35.el7  rpm-python.x86_64 0:4.11.3-35.el7 
 yum.noarch 0:3.4.3-161.el7.centos     

Complete!
Generating yum cache for rabbitmq_erlang...
Importing GPG key 0xDF309A0B:
 Userid     :"https://packagecloud.io/rabbitmq/erlang (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: 2ebd e413 d3ce 5d35 bcd1 5b7c 71c6 3471 df30 9a0b
 From       : https://packagecloud.io/rabbitmq/erlang/gpgkey
Generating yum cache for rabbitmq_erlang-source...

The repository is setup! You can now install packages.

1.2.* Install *erlang

[ root@VM_147_130_centos ~]# yum install erlang
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
- - > Running transaction check
- - - > Package erlang.x86_64 0:22.0.3-1.el7 will be installed
- - > Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================
 Package                               Arch                                  Version                                       Repository                                      Size
================================================================================================================================================================================
Installing:
 erlang                                x86_64                                22.0.3-1.el7                                  rabbitmq_erlang                                 18 M

Transaction Summary
================================================================================================================================================================================
Install  1 Package

Total download size: 18 M
Installed size: 33 M
Is this ok [y/d/N]: y
Downloading packages:
erlang-22.0.3-1.el7.x86_64.rpm                                                                                                                           |  18 MB  00:00:07     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : erlang-22.0.3-1.el7.x86_64                                                                                                                                   1/1 
 Verifying  : erlang-22.0.3-1.el7.x86_64                                                                                                                                   1/1 

Installed:
 erlang.x86_64 0:22.0.3-1.el7                                                                                                                                                  

Complete!

2. Install rabbitmq-server

2.1.* Create rabbitmq-server.repo library*

[ root@VM_147_130_centos ~]# curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
Detected operating system as centos/7.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures...
Loaded plugins: fastestmirror, langpacks
rabbitmq_erlang/x86_64/signature                                                                                                                         |  833 B  00:00:00     
rabbitmq_erlang/x86_64/signature                                                                                                                         | 1.0 kB  00:00:00 !!! 
rabbitmq_erlang-source/signature                                                                                                                         |  819 B  00:00:00     
rabbitmq_erlang-source/signature                                                                                                                         |  951 B  00:00:00 !!! 
rabbitmq_rabbitmq-server-source/signature                                                                                                                |  836 B  00:00:00     
Retrieving key from https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
Importing GPG key 0x4D206F89:
 Userid     :"https://packagecloud.io/rabbitmq/rabbitmq-server (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: 8c69 5b02 19af deb0 4a05 8ed8 f4e7 8920 4d20 6f89
 From       : https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
rabbitmq_rabbitmq-server-source/signature                                                                                                                | 1.0 kB  00:00:00 !!! 
rabbitmq_rabbitmq-server-source/primary                                                                                                                  |  175 B  00:00:02     
Loading mirror speeds from cached hostfile
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils...
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
Nothing to do
Generating yum cache for rabbitmq_rabbitmq-server...
Importing GPG key 0x4D206F89:
 Userid     :"https://packagecloud.io/rabbitmq/rabbitmq-server (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: 8c69 5b02 19af deb0 4a05 8ed8 f4e7 8920 4d20 6f89
 From       : https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
Generating yum cache for rabbitmq_rabbitmq-server-source...

The repository is setup! You can now install packages.

2.2.* Install *rabbitmq-server

[ root@VM_147_130_centos ~]# yum install rabbitmq-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
- - > Running transaction check
- - - > Package rabbitmq-server.noarch 0:3.7.15-1.el7 will be installed
- - > Processing Dependency: socat for package: rabbitmq-server-3.7.15-1.el7.noarch
- - > Running transaction check
- - - > Package socat.x86_64 0:1.7.3.2-2.el7 will be installed
- - > Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================
 Package                                   Arch                             Version                                    Repository                                          Size
================================================================================================================================================================================
Installing:
 rabbitmq-server                           noarch                           3.7.15-1.el7                               rabbitmq_rabbitmq-server                           9.8 M
Installing for dependencies:
 socat                                     x86_64                           1.7.3.2-2.el7                              os                                                 290 k

Transaction Summary
================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 10 M
Installed size: 12 M
Is this ok [y/d/N]: y
Downloading packages:
(1 /2): socat-1.7.3.2-2.el7.x86_64.rpm                                                                                                                    | 290 kB  00:00:00     
(2 /2): rabbitmq-server-3.7.15-1.el7.noarch.rpm                                                                                                           | 9.8 MB  00:00:09     
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                           1.1 MB/s |  10 MB  00:00:09     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : socat-1.7.3.2-2.el7.x86_64                                                                                                                                   1/2 
 Installing : rabbitmq-server-3.7.15-1.el7.noarch                                                                                                                          2/2 
 Verifying  : socat-1.7.3.2-2.el7.x86_64                                                                                                                                   1/2 
 Verifying  : rabbitmq-server-3.7.15-1.el7.noarch                                                                                                                          2/2 

Installed:
 rabbitmq-server.noarch 0:3.7.15-1.el7                                                                                                                                         

Dependency Installed:
 socat.x86_64 0:1.7.3.2-2.el7                                                                                                                                                  

Complete!

3. Set boot up##

[ root@VM_147_130_centos ~]# chkconfig rabbitmq-server on
Note: Forwarding request to 'systemctl enable rabbitmq-server.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.

4. Start rabbitmq node##

[ root@VM_147_130_centos]# service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service

rabbitmq process

5. Enable Administration Backend

[ root@VM_147_130_centos ~]# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@VM_147_130_centos:
rabbitmq_management
The following plugins have been configured:
 rabbitmq_management
 rabbitmq_management_agent
 rabbitmq_web_dispatch
Applying plugin configuration to rabbit@VM_147_130_centos...
The following plugins have been enabled:
 rabbitmq_management
 rabbitmq_management_agent
 rabbitmq_web_dispatch

started 3 plugins.

6. Add user

[ root@VM_147_130_centos ~]# rabbitmqctl add_user test 123456
Adding user "test"...

7. Configure user permissions

[ root@VM_147_130_centos ~]# rabbitmqctl set_user_tags test administrator
Setting tags for user "test" to [administrator]...
[ root@VM_147_130_centos ~]# rabbitmqctl set_permissions -p "/" test ".*" ".*" ".*"
Setting permissions for user "test"in vhost "/"

8. Configure firewall

RabbitMQ access port

[ root@VM_147_130_centos ~]# firewall-cmd --zone=public --add-port=15672/tcp --permanent
success
[ root@VM_147_130_centos ~]# firewall-cmd --zone=public --add-port=5671-5672/tcp --permanent
success
[ root@VM_147_130_centos ~]# firewall-cmd --zone=public --add-port=4369/tcp --permanent
success
[ root@VM_147_130_centos ~]# firewall-cmd --zone=public --add-port=25672/tcp --permanent
success
[ root@VM_147_130_centos ~]# firewall-cmd --zone=public --add-port=35672-35682/tcp --permanent
success
[ root@VM_147_130_centos ~]# firewall-cmd --reload
success

9. Access to the management background (Port: 15672)

RabbitMQ management background

rabbitmq management background homepage

**10. Close **rabbitmq node##

[ root@VM_147_130_centos ~]# service rabbitmq-server stop
Redirecting to /bin/systemctl stop rabbitmq-server.service

**11.**References##

1. Download and install RabbitMQ
2. rabbitmq’s repos
3. Centos7 install the latest RabbitMQ and configuration
4. RabbitMQ port


Two, cluster deployment#

1. Install RabbitMQ on 2 machines separately

RabbitMQ1 master node

RabbitMQ2 slave node

2. View .erlang.cook

2.1 RabbitMQ1 (master node)

[ root@VM_88_143_centos rabbitmq]# cat /var/lib/rabbitmq/.erlang.cookie
GKCVRDIVRNQIBWHJEDXU

2.2 RabbitMQ2 (slave node)

[ root@VM_26_188_centos rabbitmq]# cat /var/lib/rabbitmq/.erlang.cookie
MVXVXZDFHYZGXTPGNMJM

3. Set the RabbitMQ slave node.erlang.cookie value to the master node.erlang.cookie value##

3.1 Set .erlang.cookie value###

[ root@VM_26_188_centos rabbitmq]# chmod +w .erlang.cookie[root@VM_26_188_centos rabbitmq]# echo -e "GKCVRDIVRNQIBWHJEDXU\c" > .erlang.cookie[root@VM_26_188_centos rabbitmq]# chmod -w .erlang.cookie

3.2 Restart the slave node###

[ root@VM_26_188_centos rabbitmq]# service rabbitmq-server stop
Redirecting to /bin/systemctl stop rabbitmq-server.service
[ root@VM_26_188_centos rabbitmq]# service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service

4. Set RabbitMQ nodes to be able to ping through the host name##

[ root@VM_88_143_centos rabbitmq]# vi /etc/hosts
127.0.0.1 VM_88_143_centos VM_88_143_centos
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4

::1 VM_88_143_centos VM_88_143_centos
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

119.00.000.121 rabbit1
139.000.000.137 rabbit2
[ root@VM_26_188_centos rabbitmq]# vi /etc/hosts
127.0.0.1 VM_26_188_centos VM_26_188_centos
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4

::1 VM_26_188_centos VM_26_188_centos
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

119.00.000.121 rabbit1
139.000.000.137 rabbit2

5. RabbitMQ slave node joins RabbitMQ master node##

5.1 Stop the RabbitMQ application from the node###

[ root@VM_26_188_centos rabbitmq]# rabbitmqctl stop_app
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale"in your shell)
Stopping rabbit application on node rabbit@VM_26_188_centos ...

5.2 RabbitMQ slave node joins the master node###

[ root@VM_26_188_centos rabbitmq]# rabbitmqctl join_cluster rabbit@VM_88_143_centos
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale"in your shell)
Clustering node rabbit@VM_26_188_centos with rabbit@VM_88_143_centos

5.3 Start the application from RabbitMQ###

[ root@VM_26_188_centos ~]# rabbitmqctl start_app
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale"in your shell)
Starting node rabbit@VM_26_188_centos ...
 completed with 4 plugins.

RabbitMQ cluster

6. Mirror cluster (high availability)

6.1 set policy

[ root@VM_88_143_centos rabbitmq]# rabbitmqctl set_policy ha-all "^" '{"ha-mode":"all","ha-sync-mode":"automatic","ha-promote-on-shutdown":"always","ha-promote-on-failure":"always"}'
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale"in your shell)
Setting policy "ha-all"for pattern "^" to "{"ha-mode":"all","ha-sync-mode":"automatic","ha-promote-on-shutdown":"always","ha-promote-on-failure":"always"}" with priority "0"for vhost "/"...

RabbitMQ mirroring cluster Policies

6.2 set cluster_partition_handling

[ root@VM_88_143_centos rabbitmq]# cp /usr/share/doc/rabbitmq-server-3.7.15/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config [root@VM_88_143_centos rabbitmq]# vi /etc/rabbitmq/rabbitmq.config{cluster_partition_handling, autoheal}

7. Spring AMQP(RabbitMQ) configuration##

application.yml

spring:
 rabbitmq:
  addresses:192.168.1.200:5672,192.168.1.201:5672
  username: test
  password:123456
  template:
   retry:
   enabled: true
   initial-interval: 1s
   max-attempts:999

9. common problem##

9.1 Error joining the master node from the node###

Disable|enable RabbitMQ service need to use rabbitmqctl stop|start command, service rabbitmq-server stop|start cannot be started in service mode, otherwise the slave node cannot join the master node

[ root@VM_26_188_centos rabbitmq]# service rabbitmq-server stop
Redirecting to /bin/systemctl stop  rabbitmq-server.service
[ root@VM_26_188_centos rabbitmq]# rabbitmqctl join_cluster rabbit@VM_88_143_centos
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8(which can be verified by running "locale"in your shell)
Error: unable to perform an operation on node 'rabbit@VM_26_188_centos'. Please see diagnostics information and suggestions below.

Most common reasons forthis are:* Target node is unreachable(e.g. due to hostname resolution, TCP connection or firewall issues)* CLI tool fails to authenticate with the server(e.g. due to CLI tool's Erlang cookie not matching that of the server)* Target node is not running

In addition to the diagnostics info below:* See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@VM_26_188_centos
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact:[rabbit@VM_26_188_centos]

rabbit@VM_26_188_centos:* connected to epmd(port 4369) on VM_26_188_centos
 * epmd reports: node 'rabbit' not running at all
     no other nodes on VM_26_188_centos
 * suggestion: start the node

Current node details:* node name:'rabbitmqcli-1587-rabbit@VM_26_188_centos'* effective user's home directory:/var/lib/rabbitmq
 * Erlang cookie hash: s8dGy2phnuOLnKyqMij3gQ==

**9.2 **Error adding slave node to master node, amqp plug-in is not enabled

[ root@VM_26_188_centos rabbitmq]# vi /var/log/rabbitmq/rabbit@VM_26_188_centos.log
2019- 06- 1813:42:51.182[ info]<0.903.0> accepting AMQP connection <0.903.0>(198.108.66.161:48862->10.135.101.30:5672)2019-06-1813:42:51.183[error]<0.903.0> closing AMQP connection <0.903.0>(198.108.66.161:48862->10.135.101.30:5672):
amqp1_0_plugin_not_enabled

9.2.1 View the list of RabbitMQ plugins

[ root@VM_26_188_centos etc]# rabbitmq-plugins list
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8(which can be verified by running "locale"in your shell)
Listing plugins with pattern ".*"...
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status:*= running on rabbit@VM_26_188_centos
 | /[] rabbitmq_amqp1_0                  3.7.15[] rabbitmq_auth_backend_cache       3.7.15[] rabbitmq_auth_backend_http        3.7.15[] rabbitmq_auth_backend_ldap        3.7.15[] rabbitmq_auth_mechanism_ssl       3.7.15[] rabbitmq_consistent_hash_exchange 3.7.15[] rabbitmq_event_exchange           3.7.15[] rabbitmq_federation               3.7.15[] rabbitmq_federation_management    3.7.15[] rabbitmq_jms_topic_exchange       3.7.15[E*] rabbitmq_management               3.7.15[e*] rabbitmq_management_agent         3.7.15[] rabbitmq_mqtt                     3.7.15[] rabbitmq_peer_discovery_aws       3.7.15[] rabbitmq_peer_discovery_common    3.7.15[] rabbitmq_peer_discovery_consul    3.7.15[] rabbitmq_peer_discovery_etcd      3.7.15[] rabbitmq_peer_discovery_k8s       3.7.15[] rabbitmq_random_exchange          3.7.15[] rabbitmq_recent_history_exchange  3.7.15[] rabbitmq_sharding                 3.7.15[] rabbitmq_shovel                   3.7.15[] rabbitmq_shovel_management        3.7.15[] rabbitmq_stomp                    3.7.15[] rabbitmq_top                      3.7.15[] rabbitmq_tracing                  3.7.15[] rabbitmq_trust_store              3.7.15[e*] rabbitmq_web_dispatch             3.7.15[] rabbitmq_web_mqtt                 3.7.15[] rabbitmq_web_mqtt_examples        3.7.15[] rabbitmq_web_stomp                3.7.15[] rabbitmq_web_stomp_examples       3.7.15

9.2.2 Enable RabbitMQ AMQP plugin

[ root@VM_88_143_centos rabbitmq]# rabbitmq-plugins enable rabbitmq_amqp1_0
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8(which can be verified by running "locale"in your shell)
Enabling plugins on node rabbit@VM_88_143_centos:
rabbitmq_amqp1_0
The following plugins have been configured:
 rabbitmq_amqp1_0
 rabbitmq_management
 rabbitmq_management_agent
 rabbitmq_web_dispatch
Applying plugin configuration to rabbit@VM_88_143_centos...
The following plugins have been enabled:
 rabbitmq_amqp1_0

started 1 plugins.
[ root@VM_26_188_centos rabbitmq]# rabbitmq-plugins enable rabbitmq_amqp1_0
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8(which can be verified by running "locale"in your shell)
Enabling plugins on node rabbit@VM_26_188_centos:
rabbitmq_amqp1_0
The following plugins have been configured:
 rabbitmq_amqp1_0
 rabbitmq_management
 rabbitmq_management_agent
 rabbitmq_web_dispatch
Applying plugin configuration to rabbit@VM_26_188_centos...
The following plugins have been enabled:
 rabbitmq_amqp1_0

started 1 plugins.

10. References##

1. RabbitMQ cluster construction
2. Highly Available (Mirrored) Queues
3. RabbitMQ cluster 4. rabbitmq-Build a cluster without modifying the host name
5. RabbitMQ Getting Started Series (4)-RabbitMQ start, stop nodes and applications, user management, permission configuration
6. Three methods for CentOS7 to modify the hostname
7. Srping AMQP RabbitMQ support
8. Clustering and Network Partitions

Recommended Posts

Install RabbitMQ on CentOS 7
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
Install RabbitMQ on CentOS7
centOs install rabbitMQ
Install Docker on Centos7
install LNMP on centos7.4
Install Java on Centos 7
Install FFmpeg on CentOS 8
Install Node.js on Centos
Maven install on centos7
Install MongoDB on CentOS 7
Install Surelog on CentOS8
Install Jenkins on centos7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install mysql online on centos
Install MySQL 8.0.16 on Linux Centos
Install docker transfer on Centos7
Install docker on Centos system
install EPEL repo on centos
1.5 Install Centos7
Install Zabbix 3.4 based on CentOS 7
install virtualbox on centos server
Install Nginx server on CentOS 7
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
Install JDK8 in rpm on CentOS7
How to install Memcached on CentOS 8
Install MATE or XFCE on CentOS 7
How to install R on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
Install MySQL on Linux CentOS7 (Windows)
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
​Install Oracle database on CentOS Linux
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install TeamViewer on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8