当我执行时sudo rabbitmqctl add_user james mypassword
它返回:
Creating user "james" ...
Error: {badarg,
[{erlang,group_leader,[undefined,<5490.18387.0>],[]},
{rabbit_log,with_local_io,1,
[{file,"src/rabbit_log.erl"},{line,99}]},
{rabbit_auth_backend_internal,add_user,2,
[{file,"src/rabbit_auth_backend_internal.erl"},{line,149}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,206}]}]}
我以前没有遇到过这个问题。但是最近出现了这个错误,我不知道为什么。当我尝试以下操作时,它也会返回相同的错误sudo rabbitmqctl stop
:
Stopping and halting node rabbit@postr ...
Error: {badarg,[{erlang,group_leader,[undefined,<5490.18408.0>],[]},
{rabbit_log,with_local_io,1,
[{file,"src/rabbit_log.erl"},{line,99}]},
{rabbit,'-stop_and_halt/0-after$^0/0-0-',0,
[{file,"src/rabbit.erl"},{line,387}]},
{rabbit,stop_and_halt,0,[{file,"src/rabbit.erl"},{line,384}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,206}]}]}
我的 rabbitmq 日志文件如下所示:
=ERROR REPORT==== 1-May-2018::21:48:06 ===
closing AMQP connection <0.14307.0> (174.824.62.219:39718 -> 174.824.62.219:5672):
{handshake_error,starting,0,
{amqp_error,access_refused,
"AMQPLAIN login refused: user 'james' - invalid credentials",
'connection.start_ok'}}
但是该用户james
现在不存在,sudo rabbitmqctl list_users
返回:
Listing users ...
guest [administrator]
我尝试将我的CELERY_BROKER_URL
从更改'amqp://{}:{}@174.824.62.219/vhost'.format(config('RABBIT_USER'), config('RABBIT_PW'))
为'amqp://guest:guest@localhost'
- 但仍然出现相同的错误。
知道问题是什么吗?
编辑
service rabbitmq-server start
返回:
Job for rabbitmq-server.service failed because the control process exited with error code.
See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.
因此systemctl status rabbitmq-server.service
返回:
● rabbitmq-server.service - RabbitMQ Messaging Server
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-05-03 07:30:37 UTC; 19s ago
Process: 29946 ExecStop=/usr/sbin/rabbitmqctl stop (code=exited, status=2)
Process: 8566 ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmq-server-wait (code=exited, status=2)
Process: 8565 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 8565 (code=exited, status=1/FAILURE)
并sudo journalctl -xe
返回:
May 03 07:30:33 postr polkitd(authority=local)[1452]: Registered Authentication Agent for unix-process:8528:49657
May 03 07:30:37 postr polkitd(authority=local)[1452]: Operator of unix-process:8528:496573185 successfully authen
May 03 07:30:37 postr systemd[1]: Starting RabbitMQ Messaging Server...
-- Subject: Unit rabbitmq-server.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rabbitmq-server.service has begun starting up.
May 03 07:30:37 postr systemd[1]: rabbitmq-server.service: Main process exited, code=exited, status=1/FAILURE
May 03 07:30:37 postr rabbitmq[8566]: Waiting for rabbit@postr ...
May 03 07:30:37 postr rabbitmq[8566]: pid is 8574 ...
May 03 07:30:37 postr rabbitmq[8566]: Error: process_not_running
May 03 07:30:37 postr systemd[1]: rabbitmq-server.service: Control process exited, code=exited status=2
May 03 07:30:37 postr systemd[1]: Failed to start RabbitMQ Messaging Server.
-- 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.
May 03 07:30:37 postr systemd[1]: rabbitmq-server.service: Unit entered failed state.
May 03 07:30:37 postr systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
May 03 07:30:37 postr polkitd(authority=local)[1452]: Unregistered Authentication Agent for unix-process:8528:496
May 03 07:30:49 postr kernel: [UFW BLOCK] IN=eth0 OUT= MAC=9e:93:5d:bc:23:c5:5c:45:27:78:fb:30:08:00 SRC=77.72.82
May 03 07:30:54 postr sshd[8731]: Invalid user glassfish from 213.32.72.47
May 03 07:30:54 postr sshd[8731]: input_userauth_request: invalid user glassfish [preauth]
May 03 07:30:54 postr sshd[8731]: Received disconnect from 213.32.72.47 port 51824:11: Normal Shutdown, Thank you
May 03 07:30:54 postr sshd[8731]: Disconnected from 213.32.72.47 port 51824 [preauth]
May 03 07:31:21 postr sshd[8743]: Invalid user planos from 213.32.72.47
May 03 07:31:21 postr sshd[8743]: input_userauth_request: invalid user planos [preauth]
May 03 07:31:21 postr sshd[8743]: Received disconnect from 213.32.72.47 port 57492:11: Normal Shutdown, Thank you
May 03 07:31:21 postr sshd[8743]: Disconnected from 213.32.72.47 port 57492 [preauth]
May 03 07:31:43 postr sshd[8751]: Invalid user xbmc from 51.15.235.91
May 03 07:31:43 postr sshd[8751]: input_userauth_request: invalid user xbmc [preauth]
May 03 07:31:43 postr sshd[8751]: Received disconnect from 51.15.235.91 port 56274:11: Normal Shutdown, Thank you
May 03 07:31:43 postr sshd[8751]: Disconnected from 51.15.235.91 port 56274 [preauth]
May 03 07:31:44 postr sudo[8750]: james : TTY=pts/0 ; PWD=/home/james/postr ; USER=root ; COMMAND=/bin/journal
May 03 07:31:44 postr sudo[8750]: pam_unix(sudo:session): session opened for user root by james(uid=0)
lines 1002-1040/1040 (END)
答案1
sudo chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie
sudo chmod 600 /var/lib/rabbitmq/.erlang.cookie