04.安装RabbitMQ
# 01.centos安装rabbitmq
1、JDK1.8
2、Centos7-64位
3、Erlang-OTP 23
4、RabbitMQ-3.8.5
1
2
3
4
2
3
4
# 1.1 安装Erlang
# 1)完成erlang的前置条件配置
[root@k8s-node2 aaa]# curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
[root@k8s-node2 aaa]# yum install -y erlang
[root@k8s-node2 aaa]# erl
1
2
3
4
2
3
4
# 1.2 安装RabbitMQ
- 完成RabbitMQ的前置条件配置
# 1、先导入两个key
[root@k8s-node2 aaa]# rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
[root@k8s-node2 aaa]# rpm --import https://packagecloud.io/gpg.key
# 2、完成RabbitMQ的前置条件配置
[root@k8s-node2 aaa]# curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
# 3、下载RabbitMQ安装包
[root@k8s-node2 aaa]# wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.5/rabbitmq-server-3.8.5-1.el7.noarch.rpm
1
2
3
4
5
6
7
2
3
4
5
6
7
- 安装epel-release 和 socat
# 1)导入key
[root@k8s-node2 aaa]# rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
# 2)安装socat
[root@k8s-node2 aaa]# yum -y install epel-release
[root@k8s-node2 aaa]# yum -y install socat
1
2
3
4
5
2
3
4
5
- 安装 RabbitMQ
# 1、安装RabbitMQ
[root@k8s-node2 ~]# rpm -ivh rabbitmq-server-3.8.5-1.el7.noarch.rpm
# 2、启用管理平台插件,启用插件后,可以可视化管理RabbitMQ
[root@k8s-node2 ~]# rabbitmq-plugins enable rabbitmq_management
1
2
3
4
2
3
4
# 1.3 启动rabbitmq
# 启动rabbitmq服务
[root@k8s-node2 ~]# systemctl start rabbitmq-server
# 查看rabbitmq服务状态
[root@k8s-node2 ~]# systemctl status rabbitmq-server
1
2
3
4
2
3
4
- 访问控制台界面
- http://192.168.56.66:15672/
# 1.4 创建用户
# 1)创建用户名admin,密码aaaaaa的用户
[root@k8s-node2 ~]# rabbitmqctl add_user admin 123456
# 2)设置admin为超级管理员
[root@k8s-node2 ~]# rabbitmqctl set_user_tags admin administrator
# 3)授权远程访问
[root@k8s-node2 ~]# rabbitmqctl set_permissions -p / admin "." "." ".*"
# 4)重启RabbitMQ
[root@k8s-node2 ~]# systemctl restart rabbitmq-server
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 1.5 设置admin远程连接
第一步
第二步
上次更新: 2024/3/13 15:35:10