赞
踩
RabbitMQ官网:https://www.rabbitmq.com/
RabbitMQ官网docker安装教程:https://www.rabbitmq.com/download.html
# docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
官网安装教程:https://www.rabbitmq.com/install-rpm.html
这里安装的环境:
# uname -a
Linux localhost.localdomain 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
使用快速安装脚本:
# curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
这个脚本会在生成/etc/yum.repos.d/rabbitmq_erlang.repo文件:
# cat /etc/yum.repos.d/rabbitmq_erlang.repo [rabbitmq_erlang] name=rabbitmq_erlang baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_erlang-source] name=rabbitmq_erlang-source baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300
安装:
# yum install -y erlang
使用快速安装脚本:
# curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
这个脚本会在生成/etc/yum.repos.d/rabbitmq_rabbitmq-server.repo文件:
# cat /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo [rabbitmq_rabbitmq-server] name=rabbitmq_rabbitmq-server baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_rabbitmq-server-source] name=rabbitmq_rabbitmq-server-source baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300
然后就可以使用yum进行安装了:
# yum install socat logrotate -y
# yum install rabbitmq-server -y
启动rabbitmq:
# systemctl start rabbitmq-server # systemctl status rabbitmq-server ● rabbitmq-server.service - RabbitMQ broker Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2021-06-09 08:25:28 EDT; 27s ago Main PID: 50434 (beam.smp) Status: "Initialized" CGroup: /system.slice/rabbitmq-server.service ├─50434 /usr/lib64/erlang/erts-11.2.2.1/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -sbwt no... ├─50449 erl_child_setup 32768 ├─50472 /usr/lib64/erlang/erts-11.2.2.1/bin/epmd -daemon ├─50489 inet_gethost 4 └─50490 inet_gethost 4 Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: ########## Licensed under the MPL 2.0. Website: https://rabbitmq.com Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: Doc guides: https://rabbitmq.com/documentation.html Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: Support: https://rabbitmq.com/contact.html Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: Tutorials: https://rabbitmq.com/getstarted.html Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: Monitoring: https://rabbitmq.com/monitoring.html Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: Logs: /var/log/rabbitmq/rabbit@localhost.log Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: /var/log/rabbitmq/rabbit@localhost_upgrade.log Jun 09 08:25:22 localhost.localdomain rabbitmq-server[50434]: Config file(s): (none) Jun 09 08:25:28 localhost.localdomain rabbitmq-server[50434]: Starting broker... completed with 0 plugins. Jun 09 08:25:28 localhost.localdomain systemd[1]: Started RabbitMQ broker. # systemctl enable rabbitmq-server Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.
开启管理后台功能:
# rabbitmq-plugins enable rabbitmq_management
浏览器打开:http://192.168.80.205:15672/,管理后台的默认端口为15672,默认账户密码为guest/guest。
默认账户只能在localhost访问,这里添加一个用户:
# rabbitmqctl add_user root root
Adding user "root" ...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
# rabbitmqctl set_user_tags root administrator
Setting tags for user "root" to [administrator] ...
使用root/root进行登录:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。