rabbitmq报错Failed to start RabbitMQ broker

  • systemctl start rabbitmq-server

报错:Error: unable to connect to node rabbit@sf206152: nodedown

Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: {bad_return,
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: {{rabbit,start,[normal,[]]},
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: {'EXIT',
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: {rabbit,failure_during_boot,
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: {error,
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: {schema_integrity_check_failed,
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: [{table_attributes_mismatch,rabbit_user,
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: [username,password_hash,tags],
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: [username,password_hash,tags,
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: hashing_algorithm]}]}}}}}}}
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: Log files (may contain more information):
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: /var/log/rabbitmq/rabbit@sf206152.log
Jun 21 17:11:12 sf206152 rabbitmq-server[31112]: /var/log/rabbitmq/rabbit@sf206152-sasl.log
Jun 21 17:11:13 sf206152 rabbitmq-server[31112]: {"init terminating in do_boot",{rabbit,failure_during_boot,{could_not_start,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{rabbit,failure_du
Jun 21 17:11:14 sf206152 rabbitmq-server[31112]: Crash dump was written to: erl_crash.dump
Jun 21 17:11:14 sf206152 rabbitmq-server[31112]: init terminating in do_boot ()
Jun 21 17:11:14 sf206152 systemd[1]: rabbitmq-server.service: main process exited, code=exited, status=1/FAILURE
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: Stopping and halting node rabbit@sf206152 ...
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: Error: unable to connect to node rabbit@sf206152: nodedown
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: DIAGNOSTICS
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: ===========
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: attempted to contact: [rabbit@sf206152]
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: rabbit@sf206152:
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: * connected to epmd (port 4369) on sf206152
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: * epmd reports: node 'rabbit' not running at all
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: no other nodes on sf206152
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: * suggestion: start the node
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: current node details:
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: - node name: rabbitmqctl31207@sf206152
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: - home dir: /var/lib/rabbitmq
Jun 21 17:11:14 sf206152 rabbitmqctl[31207]: - cookie hash: cmvEv4p7/gNkQVUvRdn10w==
Jun 21 17:11:14 sf206152 systemd[1]: rabbitmq-server.service: control process exited, code=exited status=2
Jun 21 17:11:14 sf206152 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.

解决方案:

/var/lib/rabbitmq/mnesia 目录下存在rabbit@localhost.pid、rabbit@localhost、rabbit@localhost-plugins-expand,删除这3项后,再使用systemctl start rabbitmq-server启动。

 

# 启动停止重启

service rabbitmq-server start

service rabbitmq-server stop

service rabbitmq-server restart

 

# 查看状态

rabbitmqctl cluster_status

rabbitmqctl status

 

新增一个用户

[root@sf106212 etc]# rabbitmqctl add_user admin admin@2015

查看当前用户列表

[root@sf106212 etc]# rabbitmqctl list_users

设置用户角色超级管理员(administrator)

[root@sf106212 etc]# rabbitmqctl set_user_tags admin administrator

设置用户权限

[root@sf106212 etc]# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

查看指定用户的权限信息

[root@sf106212 etc]# rabbitmqctl  list_user_permissions admin

Listing permissions for user "admin" ...

/       .*      .*      .*

 

# 启动配置自动启动

rabbitmq-plugins enable rabbitmq_management

service rabbitmq-server start

chkconfig rabbitmq-server on

http://localhost:15672

posted @ 2019-06-21 17:21  qcuser  阅读(22374)  评论(2编辑  收藏  举报