赞
踩
当前最新版本为3.8.8
同时rabbitmq依赖的erlang的版本如下 【版本对应关系查看 点击跳转】
erlang官网的下载页下载地址
选择好对应的版本进行下载,下载速度还挺快的!!
我这里也把我下载好的链接放在这了
esl-erlang_23.0.2-1_centos_7_amd64.rpm
rabbitmq-server-3.8.8-1.el6.noarch.rpm
1.将rabbitmq安装包上传到linux系统中
esl-erlang_23.0.2-1_centos_7_amd64.rpm
rabbitmq-server-3.8.8-1.el6.noarch.rpm
2.安装基础依赖包
这里我单个测试了,我centos7最小安装的只需要再加上gcc和openssl
yum install gcc openssl
3.安装Erlang依赖包
[root@localhost ~]# rpm -ivh esl-erlang_23.0.2-1_centos_7_amd64.rpm warning: esl-erlang_23.0.2-1_centos_7_amd64.rpm: Header V4 RSA/SHA256 Signature, key ID a14f4fca: NOKEY error: Failed dependencies: libGL.so.1()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libGLU.so.1()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libX11.so.6()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libXxf86vm.so.1()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libatk-1.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libcairo.so.2()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libcrypto.so.10(OPENSSL_1.0.2)(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libfontconfig.so.1()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libgdk-x11-2.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libgdk_pixbuf-2.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libgtk-x11-2.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libodbc.so.2()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libpango-1.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libpangocairo-1.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libpangoft2-1.0.so.0()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libpng15.so.15()(64bit) is needed by esl-erlang-23.0.2-1.x86_64 libpng15.so.15(PNG15_0)(64bit) is needed by esl-erlang-23.0.2-1.x86_64
解决缺少的依赖包
yum install epel-release
yum install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl
依赖包安装完后就好了
[root@localhost ~]# rpm -ivh esl-erlang_23.0.2-1_centos_7_amd64.rpm
warning: esl-erlang_23.0.2-1_centos_7_amd64.rpm: Header V4 RSA/SHA256 Signature, key ID a14f4fca: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:esl-erlang-23.0.2-1 ################################# [100%]
Erlang OTP 23.0.2 installed
4.安装RabbitMQ安装包
yum install -y rabbitmq-server-3.8.8-1.el6.noarch.rpm
5. 新增登录用户
官方给出了解释
可点击官方解释 权限控制
方法1:
以前的版本是可以直接找到rabbitmq的配置文件的,新的版本去掉了;
3.7.x版本我试过复制老版本之前的一个名为【rabbitmq.config.example】的文件,可点击 rabbitmq.conf
放到/etc/rabbitmq/目录中,并改名为rabbitmq.config,并修改配置如下
58 %%
59 %% Uncomment the following line if you want to allow access to the
60 %% guest user from anywhere on the network.
61 {loopback_users, []}
62
63 %% TLS configuration.
64 %%
65 %% Related doc guide: https://www.rabbitmq.com/ssl.html.
将61行的注释打开并去掉末尾的逗号
官方既然处于安全考虑,去掉了这种登录方式,那我们就用它建议的方法来呗
方法2:
新建一个虚拟主机
rabbitmqctl add_vhost custom-vhost
新建一个用户
[root@localhost sbin]# rabbitmqctl add_user 'rabbitmq' 'rabbitmq'
Adding user "rabbitmq" ...
[root@localhost sbin]# rabbitmqctl list_users
Listing users ...
user tags
rabbitmq []
guest [administrator]
用户授权
我这里直接给他赋管理员权限
了,因为我要在管理界面中去进行管理
rabbitmqctl set_user_tags rabbitmq administrator
也可以给一般权限
# First ".*" for configure permission on every entity 可配置
# Second ".*" for write permission on every entity 可写
# Third ".*" for read permission on every entity 可读
rabbitmqctl set_permissions -p "custom-vhost" "rabbitmq" ".*" ".*" ".*"
6.执行如下命令,启动rabbitmq中的插件管理
rabbitmq-plugins enable rabbitmq_management
7.防火墙开启端口
如果是云服务器就老老实实开端口,测试的话直接关闭防火墙咯
[root@localhost rabbitmq]# systemctl stop firewalld
[root@localhost rabbitmq]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2020-09-25 11:57:50 CST; 5s ago
Main PID: 887 (code=exited, status=0/SUCCESS)
8.启动RabbitMQ的服务
#启动
systemctl start rabbitmq-server
#重启
systemctl restart rabbitmq-server
#停止
systemctl stop rabbitmq-server
8.查看服务状态
[root@localhost rabbitmq]# systemctl start rabbitmq-server [root@localhost rabbitmq]# systemctl status rabbitmq-server ● rabbitmq-server.service - LSB: RabbitMQ is a multi-protocol messaging broker Loaded: loaded (/etc/rc.d/init.d/rabbitmq-server; bad; vendor preset: disabled) Active: active (running) since Fri 2020-09-25 13:51:21 CST; 10s ago Docs: man:systemd-sysv-generator(8) Process: 35335 ExecStart=/etc/rc.d/init.d/rabbitmq-server start (code=exited, status=0/SUCCESS) CGroup: /system.slice/rabbitmq-server.service ├─35376 /bin/sh /etc/rc.d/init.d/rabbitmq-server start ├─35378 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/sbin/rabbitmq-server ├─35380 /sbin/runuser -u rabbitmq -- /usr/lib/rabbitmq/bin/rabbitmq-server ├─35399 /bin/sh /usr/lib/rabbitmq/bin/rabbitmq-server ├─35413 /usr/lib/erlang/erts-11.0.2/bin/beam.smp -W w -K true -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt... ├─35525 erl_child_setup 1024 ├─35569 inet_gethost 4 └─35570 inet_gethost 4
running 说明已经启动了
用新建的管理员用户rabbitmq登录进来了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。