问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

linux怎么安装rabbitmq

发布网友 发布时间:2022-04-21 13:43

我来回答

2个回答

热心网友 时间:2023-06-29 09:49

RabbitMQ 安装
# Install from EPEL
[root@vdevops~]# yum --enablerepo=epel -y install rabbitmq-server
[root@vdevops~]# systemctl start rabbitmq-server
[root@vdevops /]# journalctl -xe
Nov 12 01:30:01 vdevops.org CROND[3856]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: DIAGNOSTICS
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: ===========
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: attempted to contact: [rabbit@vdevops]
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: rabbit@vdevops:
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: * unable to connect to epmd (port 4369) on vdevops: timeout (timed out)
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: current node details:
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: - node name: rabbitmqctl3831@vdevops
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: - home dir: /var/lib/rabbitmq
Nov 12 01:30:04 vdevops.org rabbitmqctl[3831]: - cookie hash: s++dDMtIhAufFItw+ercBw==
Nov 12 01:30:04 vdevops.org polkitd[1007]: Unregistered Authentication Agent for unix-process:3798:36632 (system bus name :1.23, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected f
Nov 12 01:30:04 vdevops.org systemd[1]: rabbitmq-server.service: control process exited, code=exited status=2
Nov 12 01:30:04 vdevops.org systemd[1]: Failed to start RabbitMQ broker.
-- Subject: Unit rabbitmq-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rabbitmq-server.service has failed.
--
-- The result is failed.
Nov 12 01:30:04 vdevops.org systemd[1]: Unit rabbitmq-server.service entered failed state.
Nov 12 01:30:04 vdevops.org systemd[1]: rabbitmq-server.service failed.
Nov 12 01:30:42 vdevops.org systemd[1]: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 3860 (find)
Nov 12 01:30:42 vdevops.org systemd[1]: Mounting Arbitrary Executable File Formats File System...
-- Subject: Unit proc-sys-fs-binfmt_misc.mount has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit proc-sys-fs-binfmt_misc.mount has begun starting up.
Nov 12 01:30:42 vdevops.org systemd[1]: Mounted Arbitrary Executable File Formats File System.
-- Subject: Unit proc-sys-fs-binfmt_misc.mount has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit proc-sys-fs-binfmt_misc.mount has finished starting up.
--
-- The start-up result is done.

rabbitmq-server启动报错:Failed to start RabbitMQ broker

度娘解析:主机hostname配置错误,原本hostname为vdevops.org,更改为vdevops,修改hosts文件中hostname设置
[root@vdevops /]# hostnamectl set-hostname vdevops # hostname更改重启启动rabbitmq-server
[root@vdevops /]# 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 Sat 2016-11-12 01:32:41 CST; 3min 58s ago
Process: 3831 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=2)
Main PID: 3891 (beam)
CGroup: /system.slice/rabbitmq-server.service
├─3891 /usr/lib64/erlang/erts-5.10.4/bin/beam -W w -K true -A30 -P 1048576 -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.3.5/sbin/../ebin -nos...
├─3908 /usr/lib64/erlang/erts-5.10.4/bin/epmd -daemon
├─3963 inet_gethost 4
└─3964 inet_gethost 4

Nov 12 01:32:39 vdevops systemd[1]: Starting RabbitMQ broker...
Nov 12 01:32:39 vdevops systemd[1]: rabbitmq-server.service: Got notification message from PID 3908, but reception only permitted for main PID 3891
Nov 12 01:32:40 vdevops rabbitmq-server[3891]: RabbitMQ 3.3.5. Copyright (C) 2007-2014 GoPivotal, Inc.
Nov 12 01:32:40 vdevops rabbitmq-server[3891]: ## ## Licensed under the MPL. See http://www.rabbitmq.com/
Nov 12 01:32:40 vdevops rabbitmq-server[3891]: ## ##
Nov 12 01:32:40 vdevops rabbitmq-server[3891]: ########## Logs: /var/log/rabbitmq/rabbit@vdevops.log
Nov 12 01:32:40 vdevops rabbitmq-server[3891]: ###### ## /var/log/rabbitmq/rabbit@vdevops-sasl.log
Nov 12 01:32:40 vdevops rabbitmq-server[3891]: ##########
Nov 12 01:32:41 vdevops systemd[1]: Started RabbitMQ broker.
Nov 12 01:32:41 vdevops rabbitmq-server[3891]: Starting broker... completed with 0 plugins.
[root@vdevops~]# 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.

防火墙设置
[root@linuxprobe~]# firewall-cmd --add-port=5672/tcp --permanent
success
[root@linuxprobe~]# firewall-cmd --reload
success

要使用RabbitMQ,请先添加用户
[root@vdevops ~]# rabbitmqctl add_user linuxprobe password
Creating user "linuxprobe" ...
...done.
[root@vdevops ~]# rabbitmqctl list_users
Listing users ...
guest [administrator]
linuxprobe []
...done.
# granting admin role to a user is like follows
[root@vdevops ~]# rabbitmqctl change_password linuxprobe strongpassword
Changing password for user "linuxprobe" ...
...done.
# granting admin role to a user is like follows
[root@vdevops ~]# rabbitmqctl set_user_tags linuxprobe administrator
Setting tags for user "linuxprobe" to [administrator] ...
...done.
# deleting a user is like follows
[root@vdevops ~]# rabbitmqctl delete_user linuxprobe
Deleting user "linuxprobe " ...
...done.

要使用RabbitMQ,也要添加虚拟主机
[root@vdevops ~]# rabbitmqctl add_vhost /my_vhost
Creating vhost "/my_vhost" ...
...done.
[root@vdevops ~]# rabbitmqctl list_vhosts
Listing vhosts ...
/
/my_vhost
...done.
[root@vdevops ~]# rabbitmqctl delete_vhost /my_vhost
Deleting vhost "/my_vhost" ...
...done.

给虚拟主机的用户授予权限,请如下配置
# rabbitmqctl set_permissions [-p vhost] [user] [permission ? (modify) (write) (read)]
[root@vdevops ~]# rabbitmqctl set_permissions -p /my_vhost linuxprobe ".*" ".*" ".*"
Setting permissions for user "linuxprobe" in vhost "/my_vhost" ...
...done.
#
[root@vdevops ~]# rabbitmqctl list_user_permissions linuxprobe
Listing permissions for user "linuxprobe" ...
/my_vhost .* .* .*
...done.
# deleting permission of a specific user is like follows
[root@vdevops ~]# rabbitmqctl clear_permissions -p /my_vhost linuxprobe
Clearing permissions for user "linuxprobe" in vhost "/my_vhost" ...
...done.

RabbitMQ:使用Web UI
[root@vdevops ~]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
[root@vdevops ~]# systemctl restart rabbitmq-server

客户端访问

http://vdevops:15672/

rabbitmqadmin使用

可以配置RabbitMQ使用rabbitmqadmin命

在Web UI上下载rabbitmqadmin。 登录到Web UI并移动到“http://(主机名或IP地址):15672 /
cli”,然后显示以下屏幕,您可以在这里下载rabbitmqadmin,点击here右键保存rabbitmqadmin.txt,然后上传到服务器上面更改为rabbitmqadmin,并添加执行权限

将rabbitmqadmin上传到RabbitMQ服务器并设置合适的权限,此示例显示如下设置
[root@localhost ~]# ll /usr/local/bin/rabbitmqadmin
-rwxr-xr-x. 1 root root 36112 Nov 11 17:23 /usr/local/bin/rabbitmqadmin
[root@vdevops bin]# rabbitmqadmin list users
+------------+------------------------------+---------------+
| name | password_hash | tags |
+------------+------------------------------+---------------+
| guest | k2rhpzCrZBKkY5WRhUWrGm5DCkg= | administrator |
| linuxprobe | P+YxK1QXIYrJpek5i//rPjn5SME= | administrator |
+------------+------------------------------+---------------+
[root@vdevops bin]# cd
[root@vdevops ~]# rabbitmqadmin list users
+------------+------------------------------+---------------+
| name | password_hash | tags |
+------------+------------------------------+---------------+
| guest | k2rhpzCrZBKkY5WRhUWrGm5DCkg= | administrator |
| linuxprobe | P+YxK1QXIYrJpek5i//rPjn5SME= | administrator |
+------------+------------------------------+---------------+
[root@vdevops ~]# rabbitmqadmin list vhosts
+-----------+---------+
| name | tracing |
+-----------+---------+
| / | False |
| /my_vhost | False |
+-----------+---------+

详细可以参考http://www.linuxprobe.com/centos-deploy-rabbitmq.html

热心网友 时间:2023-06-29 09:50

CentOS6.7系统安装RabbitMQ3.7.8集群环境

网页链接

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
国外留学有用吗 花钱出国留学有用吗 !这叫什么号 百万医疗赔付后是否可以续保 前一年理赔过医疗险还能续保吗? 医疗住院险理赔后还能购买吗? 女生多大后可以不在长身高? 如何不用软件把手机投屏到电脑上手机屏幕怎样投放到电脑上 战时拒绝、故意延误军事订货罪既遂的处罚? 战时故意延误军事订货罪处罚标准 怎么在vmware中安装rabbitmq 404 Not Found 怎么在centos上安装rabbitmq 蟹bro是个啥? 蟹bro是什么意思? 英文谢普肉什么意思? 谢不肉的解释是什么? 猕猴桃可以放多久 成熟的猕猴桃能放多久芭芭农场 猕猴桃在常温下放几多天 猕猴桃去皮后可以放多久 成熟的猕猴桃能放多久 蚂蚁庄园 猕猴桃可以放几天? 猕猴桃一般能放多久? 猕猴桃可以放几天? 抖音之前可以上传35张照片,现在怎么不行了? 抖音照片电影最多可以上传几张照片?! 抖音为什么只能选35张照片 做抖音三分钟能用多少张照片 长春亚泰集团是干什么的? centos6 安装rabbitmq 需要建立新的用户组么 rabbitmq 3.6x 对应什么版本 erlang centos rabbitmq-server 会不会自动启动 yum安装的rabbitmq怎么修改配置文件 如何在CentOS 7部署RabbitMQ服务 java学习路线 求一份Java学习路线图 linux上应该怎样安装使用RabbitMQ rabbitmq 服务端 exchange怎么绑定queue 快手账号是否处于安全状态被别人可以登录怎么回事? 快手 用电脑可以登陆吗? 快手官方网站我怎么样才能直播?我都有一千多粉丝了, 是不是开通了快手直播权限就能天天开直播了 如何去除车内的酒味 酒吐在车里要怎么清洗? 车内吐了满是白酒味,怎么去除? 车内的酒味怎么除去酒味 车内酒吐味怎么才能去除? 车上黄色酒渍如何清洗 为无什么意思?