- 下载
erlang-24.1-1.el8.x86_64.rpm 以及rabbitmq-server-3.9.7-1.el8.noarch.rpm 。
这两个RPM包均可以在rabbitmq的Github官方库中releases里面下载。 erlang-rpm :https://github.com/rabbitmq/erlang-rpm/releases rabbitmq-server :https://github.com/rabbitmq/rabbitmq-server/releases *注意选对系统,CentOS8则是对应版本.el8.norarch.rpm这样的。
- 可选:使用WinSCP通过ftp协议上传这两个包到CentOS里面。
- 保证两个.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
- 启动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
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.
- 添加配置文件,放开guest用户只能在localhost环境下进行操作的限制
参考:https://www.rabbitmq.com/configure.html
$ vim /etc/rabbitmq/rabbitmq.conf
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
- 设置服务开机自启动。
$ systemctl enable rabbitmq-server.service
- 通过rabbitMQ Management插件可视化查看服务器情况。
$ rabbitmq-plugins enable rabbitmq_management
随后可通过ip:15672 来访问RabbitMQ Management,并可通过guest 用户登录,不会出现User can only log in via localhost. 的提示。
安装完毕,三连支持~
|