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

概述

1、错误信息描述

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

[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
[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. 使用当前环境(目录位置命令进行配置)
[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: unable to perform an operation on node ‘rabbitmq3@k8s-master1‘. Please see dia1、错误信息描述2、问题解决所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部