I. RabbitMQ initial understanding and installation

1, What is RabbitMQ?

RabbitMQ is an open source message broker and queue server, which is used to share data between different applications through common protocols. RabbitMQ is written in Erlang language and is based on AMQP protocol.

 

2, Why RabbitMQ

1. Open source, excellent performance, stable performance guarantee

2. Provide reliable message delivery (confirm), return mode (return)

3. Perfect integration with spring AMQP, rich API

4. Rich cluster mode, expression configuration, HA mode, and image queue model

5. Ensure the reliability and availability of data

 

3, Why RabbitMQ has high performance?

1.erlang was originally used in switch architecture mode, which makes rabbitmq have excellent performance in data interaction between broker s

2. Advantages of Erlang: it has the same delay as the native socket

 

4, linux Installation

Prepare one. Linux Virtual machine, teacher's machine is Linux7(CentOS 7);Configuration is better 2 G Memory above, then use Xshell Just log in. It's very important to pay attention to the preparations. First of all, let's confirm whether your virtual machine can match the local machine Ping Check the network, firewall and other infrastructure of virtual machine and local machine.

//Enter installation:

## 1. First, prepare some software on Linux, and then make some basic software packages
yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc xz

## 2. Download the required software package of RabbitMQ (the stable version of RabbitMQ 3.6.5 is used by Benshen here)
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 service command
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. Modify user login and connection heartbeat detection, pay attention to modification
vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin/rabbit.app
//Modify the < "guest" > > in point 1: loopback [users], and only keep the guest (for user login)
//Modify point 2: heartbeat is 10 (for heartbeat connection)

## 5. Install the management plug-in

## 5.1 start the service first (the command to stop, view status and restart is included later)
/etc/init.d/rabbitmq-server start | stop | status | restart

## 5.2 check whether the service is started: lsof -i:5672 (5672 is the default port of Rabbit)
rabbitmq-plugins enable rabbitmq_management

## 5.3 check whether the management port is started: 
lsof -i:15672 perhaps netstat -tnlp | grep 15672

## 6. All OK, our access address, user name and password are guest:
## http: / / your ip address: 15672/

## 7. If all goes well, so far, our environment has been installed

Tags: Programming RabbitMQ RPM Erlang CentOS

Posted on Wed, 18 Mar 2020 10:36:34 -0400 by jredwilli