在CentOS8上安装RabbitMQ3.9.7一条龙

  1. 下载erlang-24.1-1.el8.x86_64.rpm以及rabbitmq-server-3.9.7-1.el8.noarch.rpm

这两个RPM包均可以在rabbitmq的Github官方库中releases里面下载。
erlang-rpmhttps://github.com/rabbitmq/erlang-rpm/releases
rabbitmq-serverhttps://github.com/rabbitmq/rabbitmq-server/releases
*注意选对系统,CentOS8则是对应版本.el8.norarch.rpm这样的。

  1. 可选:使用WinSCP通过ftp协议上传这两个包到CentOS里面。
  2. 保证两个.rpm文件在当前目录下,安装RPM包。
$ rpm -ivh erlang-24.1-1.el8.x86_64.rpm
$ yum install socat -y  # 需要联网下载
$ rpm -ivh rabbitmq-server-3.9.7-1.el8.noarch.rpm
  1. 启动Rabbitmq-Server。
$ cd /usr/sbin/
$ rabbitmq-server start &
2021-10-06 21:27:39.285759+08:00 [info] <0.221.0> Feature flags: list of feature flags found:
2021-10-06 21:27:39.316960+08:00 [info] <0.221.0> Feature flags:   [x] implicit_default_bindings
2021-10-06 21:27:39.317015+08:00 [info] <0.221.0> Feature flags:   [x] maintenance_mode_status
2021-10-06 21:27:39.317032+08:00 [info] <0.221.0> Feature flags:   [x] quorum_queue
2021-10-06 21:27:39.317062+08:00 [info] <0.221.0> Feature flags:   [x] stream_queue
2021-10-06 21:27:39.317165+08:00 [info] <0.221.0> Feature flags:   [x] user_limits
2021-10-06 21:27:39.317182+08:00 [info] <0.221.0> Feature flags:   [x] virtual_host_metadata
2021-10-06 21:27:39.317200+08:00 [info] <0.221.0> Feature flags: feature flag states written to disk: yes
2021-10-06 21:27:40.180951+08:00 [noti] <0.44.0> Application syslog exited with reason: stopped
2021-10-06 21:27:40.181034+08:00 [noti] <0.221.0> Logging: switching to configured handler(s); following messages may not be visible in this log output

  ##  ##      RabbitMQ 3.9.7
  ##  ##
  ##########  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
  ######  ##
  ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com

  Erlang:      24.1 [jit]
  TLS Library: OpenSSL - OpenSSL 1.1.1c FIPS  28 May 2019

  Doc guides:  https://rabbitmq.com/documentation.html
  Support:     https://rabbitmq.com/contact.html
  Tutorials:   https://rabbitmq.com/getstarted.html
  Monitoring:  https://rabbitmq.com/monitoring.html

  Logs: /var/log/rabbitmq/rabbit@localhost.log
        /var/log/rabbitmq/rabbit@localhost_upgrade.log
        <stdout>

  Config file(s): /etc/rabbitmq/rabbitmq.conf

  Starting broker... completed with 3 plugins.

通过rabbitmqctl可查看是否启动成功。

$ rabbitmqctl status
$ service rabbitmq-server status
● rabbitmq-server.service - RabbitMQ broker
   Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disa>
   Active: active (running) since Wed 2021-10-06 20:50:03 CST; 11s ago
  Process: 7667 ExecStop=/usr/sbin/rabbitmqctl shutdown (code=exited, status=0/SUCCESS)
 Main PID: 7731 (beam.smp)
    Tasks: 24 (limit: 5897)
   Memory: 101.0M
   CGroup: /system.slice/rabbitmq-server.service
           ├─7731 /usr/lib64/erlang/erts-12.1/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -M>
           ├─7746 erl_child_setup 32768
           ├─7769 /usr/lib64/erlang/erts-12.1/bin/epmd -daemon
           ├─7790 inet_gethost 4
           └─7791 inet_gethost 4

10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:   Doc guides:  https://rabbitmq.com/documen>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:   Support:     https://rabbitmq.com/contact>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:   Tutorials:   https://rabbitmq.com/getstar>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:   Monitoring:  https://rabbitmq.com/monitor>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:   Logs: /var/log/rabbitmq/rabbit@localhost.>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:         /var/log/rabbitmq/rabbit@localhost_>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:         <stdout>
10月 06 20:50:02 localhost.ws rabbitmq-server[7731]:   Config file(s): /etc/rabbitmq/rabbitmq.co>
10月 06 20:50:03 localhost.ws rabbitmq-server[7731]:   Starting broker... completed with 3 plugi>
10月 06 20:50:03 localhost.ws systemd[1]: Started RabbitMQ broker.
  1. 添加配置文件,放开guest用户只能在localhost环境下进行操作的限制
    参考:https://www.rabbitmq.com/configure.html默认配置文件路径
$ vim /etc/rabbitmq/rabbitmq.conf  # 新建一个配置文件
# 写入以下内容,:wq保存
loopback_users.guest = false

上面写入配置文件的内容表示让rabbitmq的默认用户guest可以在任何网络中登录到当前的rabbitmq服务器上。
原配置项的注释如下:Uncomment the following line if you want to allow access to the guest user from anywhere on the network.

更多配置内容请看:https://github.com/rabbitmq/rabbitmq-server/blob/v3.8.x/deps/rabbit/docs/rabbitmq.conf.example

  1. 设置服务开机自启动。
$ systemctl enable rabbitmq-server.service
  1. 通过rabbitMQ Management插件可视化查看服务器情况。
$ rabbitmq-plugins enable rabbitmq_management # 启用插件

随后可通过ip:15672来访问RabbitMQ Management,并可通过guest用户登录,不会出现User can only log in via localhost.的提示。

安装完毕,三连支持~

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值