Installation of rabbitmq under linux and setting up remote user access

首先需要安装erlang  参考:http://fedoraproject.org/wiki/EPEL/FAQ#howtouse
安装前准备 yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel java-1.7.0-openjdk-devel.x86_64 -y
① 执行后如果报错可忽视
rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
②
    yum install erlang
    安装过程中会有提示,一路输入“y”即可。

或者
    下载Erlang安装包
    wget http://erlang.org/download/otp_src_20.2.tar.gz
    安装erlang,并设置环境变量

    [root@bogon rabbitmq]# tar -zxvf otp_src_20.2.tar.gz 
     
    [root@bogon rabbitmq]# cd otp_src_20.2
     
    [root@bogon rabbitmq]# ./configure --prefix=/rabbitmq --without-javac
     
    [root@bogon rabbitmq]# make 
     
    [root@bogon rabbitmq]# make install
     
    [root@bogon rabbitmq]# vi /etc/profile
     
    ##在文件最末尾加上以下两行,保存
    #set erlang environment
    export PATH=$PATH:/rabbitmq/otp_src_20.2/bin
     
    #使配置文件生效
    [root@bogon rabbitmq]# source /etc/profile
     
    #查看是否成功安装erlang
    [root@bogon rabbitmq]# erl

Install RabbitMQ when done:

3. Create a folder by yourself to download and install, or you can execute it directly

First download the rpm:

wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el7.noarch.rpm

下载完成后安装
yum install rabbitmq-server-3.6.6-1.el7.noarch.rpm 

Start the service when done:

service rabbitmq-server start // 方式1
systemctl start rabbitmq-server.service// 方式2

Ignore the beginning - otherwise you won't be able to go anywhere oh dear

You can view the service status:

service rabbitmq-server status

Here you can see the location of the log file, go to the file location, and open the file:

This shows that the configuration file was not found, we can create this file ourselves

cd /etc/rabbitmq/
vi rabbitmq.config

Edited as follows:

[{rabbit, [{loopback_users, []}]}]

The meaning here is open to use. The user guest created by rabbitmq by default has a password of guest. This user can only be accessed locally by default, localhost or 127.0.0.1. For external access, the above configuration needs to be added.

Restart the service after saving the configuration:

service rabbitmq-server stop
service rabbitmq-server start

At this point, it can be accessed from the outside, but when I look at the log file again, I find that the content is still the same, and it still shows that the configuration file is not found. You can manually delete this file and restart the service, but this does not affect the use.

rm [email protected] 
service rabbitmq-server stop
service rabbitmq-server start

Ignore the end and keep going, dear.

Then it is to open port 15672. If it is an Alibaba Cloud server, you need to open the port in the Alibaba Cloud background. If it is your own virtual machine, you need to search for the opening method.

Open the management UI:

rabbitmq-plugins enable rabbitmq_management

输入地址打开ui界面http://192.168.2.221:15672

Add user and authorize using command

rabbitmqctl add_user admin admin

set permissions

rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"

Set user roles

rabbitmqctl set_user_tags admin administrator

View the newly added admin

rabbitmqctl list_users

http://192.168.2.221:15672

Enter admin admin to log in

After logging in as follows

rabbitmq six working mode

https://blog.csdn.net/qq_33040219/article/details/82383127

rabbitmq user permission settings

https://www.cnblogs.com/mingaixin/p/4134920.html

1. Uninstall

[root@zabbix_server lib]# rpm -qa|grep rabbitmq
rabbitmq-server-3.6.5-1.noarch
[root@zabbix_server lib]# rpm -e --nodeps rabbitmq-server

2. At this point, be sure to manually delete the rabbitmq directory

rm -rf /etc/rabbitmq
rm -rf /usr/lib/rabbitmq

Guess you like

Origin blog.csdn.net/m0_54853503/article/details/124289342
Recommended