我有一个版本10.04的ubuntu服务器,并使用sudo apt-get install rabbitmq-server
安装了rabbitmq-server。
当我尝试运行rabbitmq-server
时,它返回了以下错误
{error_logger,{{2014,7,7},{12,10,27}},"Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces",[]}
{error_logger,{{2014,7,7},{12,10,27}},crash_report,[[{initial_call,{auth,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},{error_info,{exit,{"Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces",[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[<0.18.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,24},{reductions,598}],[]]}
{error_logger,{{2014,7,7},{12,10,27}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{"Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces",[{auth,init_cookie,0},{auth,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{offender,[{pid,undefined},{name,auth},{mfa,{auth,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2014,7,7},{12,10,27}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2014,7,7},{12,10,27}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
那是什么以及如何避免它?
答案 0 :(得分:10)
我在意外更改权限时遇到了这样的错误。所以,解决它:
chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie
chmod 600 /var/lib/rabbitmq/.erlang.cookie
答案 1 :(得分:1)
根据此页面: http://www.rabbitmq.com/man/rabbitmqctl.1.man.html
使用:
sudo rabbitmqctl start_app
启动服务
或参考此页:
http://www.rabbitmq.com/install-debian.html
使用debian / ubuntu特定方法启动服务器 - 您需要是root用户或具有root用户权限(sudo)
希望这有帮助,
答案 2 :(得分:0)
{error_logger,{{2014,7,7},{12,10,27}},"Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces",[]}
意味着运行该命令的 rabbit 用户无权访问 .erlang.cookie 文件。所以,为了修复它,
chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie
那么,
chmod 400 /var/lib/rabbitmq/.erlang.cookie
答案 3 :(得分:-1)
尝试用 sudo service rabbitmq-server start