Rabbitmq 的安装
Linux 平台
Installing on Debian and Ubuntu | RabbitMQ
里面有个脚本直接 复制就可以其他不用看
#!/bin/sh
sudo apt-get install curl gnupg apt-transport-https -y
## Team RabbitMQ's main signing key
curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null
## Community mirror of Cloudsmith: modern Erlang repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null
## Community mirror of Cloudsmith: RabbitMQ repository
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null
## Add apt repositories maintained by Team RabbitMQ
sudo tee /etc/apt/sources.list.d/rabbitmq.list <<EOF
## Provides modern Erlang/OTP releases
##
deb [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
# another mirror for redundancy
deb [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-erlang/deb/ubuntu jammy main
## Provides RabbitMQ
##
deb [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa1.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
# another mirror for redundancy
deb [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
deb-src [signed-by=/usr/share/keyrings/rabbitmq.9F4587F226208342.gpg] https://ppa2.novemberain.com/rabbitmq/rabbitmq-server/deb/ubuntu jammy main
EOF
## Update package indices
sudo apt-get update -y
## Install Erlang packages
sudo apt-get install -y erlang-base \
erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
erlang-runtime-tools erlang-snmp erlang-ssl \
erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
## Install rabbitmq-server and its dependencies
sudo apt-get install rabbitmq-server -y --fix-missing
mac平台
brew install rabbitmq 即可
Rabbitmq的监控
如果是 ubunutu 需要启动服务 和别的一样,还需要另外启用 rabbitmq_manager
可以参考这个博客
https://www.cnblogs.com/hunttown/p/17352729.html
但是这个博客的问题,在于目前默认只监听localhost 不修改监听ip则无用
修改的文件 如果是 ubuntu 则在 /etc/rabbitmq/rabbitmq.conf (默认是没有的,需要自行创建)
listeners.tcp.default = 0.0.0.0:5672
management.tcp.port = 15672
management.tcp.ip = 0.0.0.0
可以看日志看是不是加载成功
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2024-04-03 14:51:24 UTC; 39min ago
Main PID: 21698 (beam.smp)
Tasks: 23 (limit: 1121)
Memory: 102.0M
CPU: 9.451s
CGroup: /system.slice/rabbitmq-server.service
├─21698 /usr/lib/erlang/erts-14.2.3/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -pc unicode -P 1048>
├─21709 erl_child_setup 32768
├─21726 /usr/lib/erlang/erts-14.2.3/bin/inet_gethost 4
├─21727 /usr/lib/erlang/erts-14.2.3/bin/inet_gethost 4
├─21739 /usr/lib/erlang/erts-14.2.3/bin/epmd -daemon
└─21761 /bin/sh -s rabbit_disk_monitor
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Release series support status: supported
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Doc guides: https://www.rabbitmq.com/docs/documentation
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Support: https://www.rabbitmq.com/docs/contact
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Tutorials: https://www.rabbitmq.com/tutorials
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Monitoring: https://www.rabbitmq.com/docs/monitoring
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Logs: /var/log/rabbitmq/rabbit@ip-172-31-40-119.log
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: <stdout>
Apr 03 14:51:22 ip-172-31-40-119 rabbitmq-server[21698]: Config file(s): /etc/rabbitmq/rabbitmq.conf
Apr 03 14:51:24 ip-172-31-40-119 rabbitmq-server[21698]: Starting broker... completed with 3 plugins.
Apr 03 14:51:24 ip-172-31-40-119 systemd[1]: Started RabbitMQ broker.
如果没有配置文件 标红的部分是没有这行日志的,具体监听端口情况,可以去上面的日志文件处查看。
求助
有没有也在 amazon EC2 上面做这个的大哥, 我下载之后。curl localhost 可以,安全组也配置放开了端口,但是 私网和公网ip访问都失败,本地mac则没有问题,怀疑是amazon某些设置导致的。。。
我真的很需要帮助。。。
版权归原作者 vince_hamma 所有, 如有侵权,请联系我们删除。