windows安装
- rabbitMQ是由erlang语言开发,所以需先安装erlang
- 下载rabbitMQ、erlang执行文件直接按下一步安装
-
打开rabbitMQ控制台:
- 控制台执行下列命令即可访问web管理界面
rabbitmq-plugins enable rabbitmq_management
-
rabbitMQ web管理界面访问端口为15672
-
默认登录用户名 密码都为guest
-
创建用户
-
创建好的用户显示Can access virtual hosts
-
创建virtual hosts
virtual hosts相当于mysql 数据库,名称以/开头
-
将创建的virtual hosts授权给用户访问
通过点击创建的virtual hosts
-
成功将创建的virtual hosts授权给用户
sentOS安装
- 添加仓库地址
vi /etc/yum.repos.d/rabbitmq_erlang.repo
通过下列命令查看内核版本
cat /etc/redhat-release
当系统为sentOS7时:
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
当系统为sentOS6时:
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/6/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/6/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
- 通过仓库安装erlang
sudo yum install -y erlang
- 安装rabbitMQ(方法一)
下载rabbitMQ rpm文件
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.17/rabbitmq-server-3.7.17-1.el7.noarch.rpm
rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
sudo yum install rabbitmq-server-3.7.17-1.el7.noarch.rpm
- 安装rabbitMQ(方法二)
导入key
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
添加rabbitMQ仓库地址
vi /etc/yum.repos.d/rabbitmq.repo
当为sentOS7时:
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1
当为sentOS6时:
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/6/
gpgcheck=0
repo_gpgcheck=0
enabled=1
安装rabbitMQ
yum install -y rabbitmq-server
配置可视化RabbitMQ管理界面
在linux上运行,输入 /usr/sbin/rabbitmq-plugins enable rabbitmq_management,这样就可以添加可视化插件了。
查看可视化插件是否成功:
由于guest用户只能本机(localhost或127.0.0.1)访问,所以在linux上的还需要配置添加一个其他的用户名,以及对该用户名进行授权,才可以用web 的方式进行访问。
在web浏览器中,输入自己的ip地址和端口号访问,如:http://IP:15672/
输入账号: mytest 密码: mytest
就可以登录查看rabbitmq里的资源信息。
这里可以先简单的输入以下的命令,添加mytest用户,及对mytest用户进行授权,使其可以用web的方式进行访问。
rabbitmqctl add_user mytest mytest
rabbitmqctl set_user_tags mytest administrator
rabbitmqctl set_permissions -p / mytest '.' '.' '.*'
rabbitmqctl list_permissions
添加mytest用户及授权之后,就可以用ip的形式进行访问了。