我是靠谱客的博主 矮小大米,这篇文章主要介绍Rabbitmq添加用户错误:Error: unable to perform an operation on node ‘rabbitmq3@k8s-master1‘. Please see dia1、错误信息描述2、问题解决,现在分享给大家,希望可以做个参考。

1、错误信息描述

今天在测试单节点rabbitmq时发现错误信息,记录一下

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@k8s-master1 sbin]# rabbitmqctl add_user admin 123456 Error: unable to perform an operation on node 'rabbitmq3@k8s-master1'. Please see diagnostics information and suggestions below. Most common reasons for this are: * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues) * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server) * Target node is not running In addition to the diagnostics info below: * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more * Consult server logs on node rabbitmq3@k8s-master1 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools DIAGNOSTICS =========== attempted to contact: ['rabbitmq3@k8s-master1'] rabbitmq3@k8s-master1: * connected to epmd (port 4369) on k8s-master1 * epmd reports: node 'rabbitmq3' not running at all other nodes on k8s-master1: [mq1] * suggestion: start the node Current node details: * node name: 'rabbitmqcli-832-rabbitmq3@k8s-master1' * effective user's home directory: /root * Erlang cookie hash: mG6tHqVyZ4ibmooTpymD9A==

2、问题解决

  1. 根据其他网友提供的方法,配置/etc/hosts域名解析;添加127.0.0.1和本机ip
复制代码
1
2
3
4
5
6
7
8
[root@k8s-master1 sbin]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 k8s-master1 192.168.6.20 k8s-master1

我这里没有用,因为不是这个问题导致的

  1. 根据第一步配置完成后,发现依然还是报这个错误,最后想起来之前搭建过rabbitmq的环境并且配置了环境变量;
  2. 恍然大悟,原来我这里使用了其他环境的命令进行设置
  3. 使用当前环境(目录位置命令进行配置)
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@k8s-master1 sbin]# ./rabbitmqctl add_user admin 123456 Adding user "admin" ... Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more. [root@k8s-master1 sbin]# ./rabbitmqctl set_user_tags admin administrator Setting tags for user "admin" to [administrator] ... [root@k8s-master1 sbin]# ./rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*" Setting permissions for user "admin" in vhost "/" ... [root@k8s-master1 sbin]# ./rabbitmqctl list_users Listing users ... user tags admin [administrator] guest [administrator] [root@k8s-master1 sbin]#

最后给推荐一下个人博客:
个人博客
rabbitmq基础环境搭建

最后

以上就是矮小大米最近收集整理的关于Rabbitmq添加用户错误:Error: unable to perform an operation on node ‘rabbitmq3@k8s-master1‘. Please see dia1、错误信息描述2、问题解决的全部内容,更多相关Rabbitmq添加用户错误:Error:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部