Lxn-Chan!

(~ ̄▽ ̄)→))* ̄▽ ̄*)o

本文将解决在开启RabbitMQ的Web端管理且曾经修改过本机域名(主机名)时可能的报错:{:query, :rabbit@xxx, {:badrpc, :timeout}}

其实就是RabbitMQ在调用RPC时使用的是本机的域名(主机名)而非IP地址,此时如果对应的域名没有解析到本机IP上,就会出现badrpc的错误。

修复方式也很简单,只需将本机IP解析到对应的域名(主机名)上或者写入/etc/hosts即可。

  1. 获取本机域名(主机名)
    1
    2
    [root@resc ~]# hostname
    resc.itp3.virt.domain.cn
  2. 写入/etc/hosts,注意,要写入域名的第一段和整个域名
    1
    2
    3
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    127.0.0.1 resc.itp3.virt.domain.cn resc

之后就可以正常使用了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@resc ~]# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@resc:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@resc...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch

set 3 plugins.
Offline change; changes will take effect at broker restart.

 简单说两句



联系站长 | 服务状态 | 友情链接

备案号:辽ICP备19013963号

萌ICP备 20219421 号

中国互联网违法和不良信息举报中心

架构版本号:8.1.5 | 本站已全面支持IPv6

正在载入运行数据(1/2)请稍后...
正在载入运行数据(2/2)请稍后...

Copyright 2024 LingXuanNing, All rights reserved.