Install RabbitMQ3.6.1 under Centos7

Install dependencies

yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget

 

Install the erlang locale

  • Download and install
tar -xzvf otp_src_18.3.tar.gz   // Unzip 
cd otp_src_18.3/ // Switch to the installation path./configure 
--prefix=/usr/local/erlang   // Production installation configuration 
make && make install   // Compile and install
  • Configure erlang environment variables
vi /etc/profile   // Add the following at the bottom 
    #set erlang environment
    ERL_HOME=/usr/local/erlang
    PATH=$ERL_HOME/bin:$PATH
    export ERL_HOME PATH

source /etc/profile   // effective
  • To test whether the installation is successful, enter the command erl in the console
erl   // If you enter the erlang shell, the installation is successful, and you can exit.

 

Download and install RabbitMQ

  • Download and install
tar -xvf rabbitmq-server-generic-unix-3.6.1.tar

After decompression, there is a folder rabbitmq-server-3.6.1, renamed rabbitmq for memory.

mv rabbitmq_server-3.6.1/ rabbitmq
  • Configure rabbitmq environment variables
vi /etc/profile
    #set rabbitmq environment
    export PATH=$PATH:/usr/local/rabbitmq/sbin
source /etc/profile
  • start the service
rabbitmq-server -detached // Start rabbitmq, -detached represents background daemon start.

Check the status, if the following screenshot is displayed, the installation is successful:

rabbitmqctl status

 

Other related commands

启动服务:rabbitmq-server -detached【 /usr/local/rabbitmq/sbin/rabbitmq-server  -detached 】
View status: rabbitmqctl status [ /usr/local/rabbitmq/sbin/ rabbitmqctl status ]
Shut down the service: rabbitmqctl stop [ /usr/local/rabbitmq/sbin/ rabbitmqctl stop ]
List roles: rabbitmqctl list_users

 

Configure web plugins

Create the directory first, otherwise an error may be reported:

mkdir /etc/rabbitmq

Then enable the plugin:

rabbitmq-plugins enable rabbitmq_management

 

Configure the firewall

Configure linux port 15672 web management 5672 AMQP port:

firewall-cmd --permanent --add-port=15672/tcp
firewall-cmd --permanent --add-port=5672/tcp
systemctl restart firewalld.service

Now you can enter the server IP: 15672 in the browser and you can see the RabbitMQ WEB management page. Are you excited, but you don't have an account and password, so don't worry.



Configure access account password and permissions

The default web page is not allowed to access, you need to add a user to modify the permissions, the code is as follows:

rabbitmqctl add_user superrd superrd   // Add a user, the last two parameters are the username and password, I use superrd for this. 
rabbitmqctl set_permissions -p / superrd ".*" ".*" ".*"   // Add permissions 
rabbitmqctl set_user_tags superrd administrator   // Modify user roles

Then you can access it remotely, and then you can directly configure user permissions and other information.

Login: http://ip:15672 After logging in, delete the guest in the admin.

 

Congratulations, your RabbitMQ is installed!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325276675&siteId=291194637