当前位置:   article > 正文

rabbitmq实战(二)——rabbitmq安装(centos7)_centos7 libgdk-x11-2.0

centos7 libgdk-x11-2.0

rabbitmq安装

rabbitmq官网

当前最新版本为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
  • 1
  • 2

2.安装基础依赖包

这里我单个测试了,我centos7最小安装的只需要再加上gcc和openssl

yum install gcc openssl
  • 1

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

解决缺少的依赖包

yum install epel-release        

yum install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl
  • 1
  • 2
  • 3

依赖包安装完后就好了

[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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

4.安装RabbitMQ安装包

	yum install -y rabbitmq-server-3.8.8-1.el6.noarch.rpm
  • 1

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.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

将61行的注释打开并去掉末尾的逗号

我后来使用3.8.8版本发现及时修改了也还是不生效,远程连不上

官方既然处于安全考虑,去掉了这种登录方式,那我们就用它建议的方法来呗

方法2:

  • 新建一个虚拟主机
    名为 custom-vhost
rabbitmqctl add_vhost custom-vhost

  • 1
  • 2
  • 新建一个用户
    在这里插入图片描述
[root@localhost sbin]# rabbitmqctl add_user 'rabbitmq' 'rabbitmq'
Adding user "rabbitmq" ...
[root@localhost sbin]# rabbitmqctl list_users
Listing users ...
user    tags
rabbitmq        []
guest   [administrator]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 用户授权

我这里直接给他赋管理员权限了,因为我要在管理界面中去进行管理

rabbitmqctl set_user_tags rabbitmq administrator
  • 1

也可以给一般权限

在这里插入图片描述

# 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" ".*" ".*" ".*"
  • 1
  • 2
  • 3
  • 4

6.执行如下命令,启动rabbitmq中的插件管理

rabbitmq-plugins enable rabbitmq_management
  • 1

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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

8.启动RabbitMQ的服务

#启动
systemctl start rabbitmq-server
#重启
systemctl restart rabbitmq-server
#停止
systemctl stop rabbitmq-server
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

running 说明已经启动了

后台管理界面

用新建的管理员用户rabbitmq登录进来了

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/558194
推荐阅读
相关标签
  

闽ICP备14008679号