CentOS7安装RabbitMQ
由于rabbitmq是基于erlang语言开发的,所以必须先安装erlang。
安装依赖
| yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget gtk2-devel binutils-devel
|
安装erlang
erlang官网: https://www.erlang.org/downloads
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| wget http://erlang.org/download/otp_src_22.0.tar.gz
tar -zxvf otp_src_22.0.tar.gz
mv otp_src_22.0 /usr/local/
cd /usr/local/otp_src_22.0/
mkdir ../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
|
安装RabbitMQ
rabbitmq下载地址:https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server-generic-unix-3.7.15.tar.xz
yum install -y xz
/bin/xz -d rabbitmq-server-generic-unix-3.7.15.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.7.15.tar
mv rabbitmq_server-3.7.15/ /usr/local/
mv /usr/local/rabbitmq_server-3.7.15 rabbitmq
echo 'export PATH=$PATH:/usr/local/rabbitmq/sbin' >> /etc/profile
source /etc/profile
mkdir /etc/rabbitmq
|
启动命令
| rabbitmq-server -detached
rabbitmqctl stop
rabbitmqctl status
|
防火墙之类的请自行处理(5672和15672端口),反正我是从来不开防火墙。
WEB管理
开启web插件
| rabbitmq-plugins enable rabbitmq_management
|
访问:http://127.0.0.1:15672/
默认账号密码:guest guest(这个账号只允许本机访问)
用户管理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| rabbitmqctl list_users
rabbitmqctl add_user zhaobl 123456
rabbitmqctl set_permissions -p "/" zhaobl ".*" ".*" ".*"
rabbitmqctl list_user_permissions zhaobl
rabbitmqctl set_user_tags zhaobl administrator
rabbitmqctl delete_user guest
|