11-1、docker run -it --name rabbitMQ -p 5672:5672 -p 15672:15672 docker.io/centos:latest
11-2 、安装erlang
##安装依赖
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget gtk2-devel binutils-devel
##官网 https://www.erlang.org/downloads otp 22.3
wget http://erlang.org/download/otp_src_22.3.tar.gz
##解压
tar -zxvf otp_src_22.3.tar.gz
##移走
mv otp_src_22.3 /usr/local/
##切换目录
cd /usr/local/otp_src_22.3/
##创建即将安装的目录
mkdir ../erlang
###pwd /usr/local/erlang
##配置安装路径
./configure --prefix=/usr/local/erlang
如下图错误 略过
##安装
make install
##查看是否安装成功
ll /usr/local/erlang/bin
##添环境变量
echo 'export PATH=$PATH:/usr/local/erlang/bin' >> /etc/profile
##刷新环境变量
source /etc/profile
#甩运行一条命令
erl
#在输入halt().命令退出来(那个点号别忘记)
11-3、安装RabbitMQ
##下载
##wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.3/rabbitmq-server-3.8.3.tar.xz
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.3/rabbitmq-server-generic-unix-3.8.3.tar.xz
##tar.xz格式安装xz
yum install -y xz
##解压
/bin/xz -d rabbitmq-server-generic-unix-3.8.3.tar.xz
##解压
tar -xvf rabbitmq-server-generic-unix-3.8.3.tar
##移走
mv rabbitmq_server-3.8.3 /usr/local/
##改名
mv /usr/local/rabbitmq_server-3.8.3 rabbitmq
##配变量
echo 'export PATH=$PATH:/usr/local/rabbitmq/sbin' >> /etc/profile
##刷环境变量
source /etc/profile
##配置目录
mkdir /etc/rabbitmq
11-4、启动rabbitmq-server
##rabbitmq-web
##启动
#####cd /usr/local/rabbitmq/sbin
rabbitmq-server -detached
##./rabbitmq-server start
##停止:
#####cd /usr/local/rabbitmq/sbin
rabbitmqctl stop
##状态:
#####cd /usr/local/rabbitmq/sbin
rabbitmqctl status
##开启web插件
#####cd /usr/local/rabbitmq/sbin
rabbitmq-plugins enable rabbitmq_management
##curl http://192.168.157.128:15672/
########5672 15672########################
##ps -ef |grep 15672
11-5、rabbitmq-server新增用户root
##所有用户
rabbitmqctl list_users
##添加用户
rabbitmqctl add_user root root
##配置权限
rabbitmqctl set_permissions -p "/" root ".*" ".*" ".*"
##用户权限
rabbitmqctl list_user_permissions root
##设置tag
rabbitmqctl set_user_tags root administrator
删除用户(安全起见,删除默认用户)
rabbitmqctl delete_user guest