1. Install Erlang

1.1 Online Installation

yum install esl-erlang_173.-1~centos~6_amd64.rpm

yum install esl-erlang-compat-R14B-1.el6.noarch.rpm
Copy the code

1.2 Offline Installation

1. Download the Erlang installation package and upload it to the VM.



2. Run the following commands in sequence:

1) the ivh esl - Erlang RPM -17.3-1.x86_64.rpm --force --nodeps
Copy the code

2) the ivh esl RPM - erlang_173.-1~centos~6_amd64.rpm --force --nodeps
Copy the code

3) the ivh esl RPM - Erlang - compat - R14B -1.el6.noarch.rpm --force --nodeps
Copy the code

2. Install the RabbitMQ

1. Download the installation package



2. Upload the file to the VM



3. The installation

rpm -ivh rabbitmq-server-3.41.-1.noarch.rpm
Copy the code

2.1 Setting the Configuration File

cp /usr/share/doc/rabbitmq-server-3.41./rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
Copy the code

Enable remote access

vi /etc/rabbitmq/rabbitmq.config
Copy the code



Be careful to remove the trailing comma.

2.2 Start & Stop

service rabbitmq-server start

service rabbitmq-server stop

service rabbitmq-server restart
Copy the code

2.3 Starting the Web Management Tool

rabbitmq-plugins enable rabbitmq_management

service rabbitmq-server restart
Copy the code

2.4 Setting startup

chkconfig rabbitmq-server on
Copy the code

2.5 Firewall Enables port 15672

/sbin/iptables -I INPUT -p tcp --dport 15672 -j ACCEPT

/etc/rc.d/init.d/iptables save
Copy the code

3. Interface management

3.1 Home Page Overview

You need to log in to the system for the first time. The default account password is:guest / guest



Connections: Both producers and consumers need to establish a connection to RabbitMQ to produce and consume messages. See connections here

You can use channels to deliver messages.

Exchanges: Exchanges used to route messages

Queues: Queues in which messages are stored, wait to be consumed, and then removed from the queue. \

Port:

5672: Programming language client connection port for rabbitMq

15672: rabbitMq management interface port

25672: Port of the rabbitMq cluster

3.2 Adding a User

If we do not use guest, we can also create a user ourselves:



1. Super administrator

Can log in the management console, can view all the information, and can operate the user, policy.

2. Monitoring

Log on to the management console and view rabbitMQ node information (number of processes, memory usage, disk usage, etc.)

3. Policymaker

You can log in to the management console and manage policies. However, you cannot view the node information (marked by the red box in the figure above).

4. Management

You can only log in to the management console. You cannot see node information or manage policies.

5, other

Unable to log on to the administrative console, it is usually the ordinary producer and consumer.

3.3 Creating Virtual Hosts

To allow individual users to work independently, RabbitMQ adds the concept of Virtual Hosts. In fact, it is an independent access path. Different users use different paths and have their own queues and switches, which do not affect each other.

Virtual host: similar to the Database in mysql. They all start with a /

3.4 Setting Permissions

Create a good virtual host, but also to add access to the user.

Click the added virtual host:

Enter the virtual host setting interface:



Final result: