问题1
使用命令启动
service rabbitmq-server start
报错如下:
Starting rabbitmq-server (via systemctl): 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. [FAILED]
解决办法:
尝试下面的操作:
禁用 SELinux ,修改 /etc/selinux/config
SELINUX=disabled
修改后重启系统
问题2:
一般使用命令
rabbitmq-server start
可以查看启动相关日志的
BOOT FAILED =========== Error description: {could_not_start,rabbit, {{badmatch, {error, {{{badmatch, {error, {not_a_dets_file, "/var/lib/rabbitmq/mnesia/rabbit@n1/recovery.dets"}}}, [{rabbit_recovery_terms,open_table,0, [{file,"src/rabbit_recovery_terms.erl"},{line,126}]}, {rabbit_recovery_terms,init,1, [{file,"src/rabbit_recovery_terms.erl"},{line,107}]}, {gen_server,init_it,6,[{file,"gen_server.erl"},{line,328}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,247}]}]}, {child,undefined,rabbit_recovery_terms, {rabbit_recovery_terms,start_link,[]}, transient,30000,worker, [rabbit_recovery_terms]}}}}, [{rabbit_queue_index,start,1, [{file,"src/rabbit_queue_index.erl"},{line,491}]}, {rabbit_variable_queue,start,1, [{file,"src/rabbit_variable_queue.erl"},{line,466}]}, {rabbit_priority_queue,start,1, [{file,"src/rabbit_priority_queue.erl"},{line,92}]}, {rabbit_amqqueue,recover,0, [{file,"src/rabbit_amqqueue.erl"},{line,240}]}, {rabbit,recover,0,[{file,"src/rabbit.erl"},{line,800}]}, {rabbit_boot_steps,'-run_step/2-lc$^1/1-1-',1, [{file,"src/rabbit_boot_steps.erl"},{line,49}]}, {rabbit_boot_steps,run_step,2, [{file,"src/rabbit_boot_steps.erl"},{line,49}]}, {rabbit_boot_steps,'-run_boot_steps/1-lc$^0/1-0-',1, [{file,"src/rabbit_boot_steps.erl"},{line,26}]}]}} Log files (may contain more information): /var/log/rabbitmq/rabbit@n1.log /var/log/rabbitmq/rabbit@n1-sasl.log {"init terminating in do_boot",{could_not_start,rabbit,{{badmatch,{error,{{{badmatch,{error,{not_a_dets_file,"/var/lib/rabbitmq/mnesia/rabbit@n1/recovery.dets"}}},[{rabbit_recovery_terms,open_table,0,[{file,"src/rabbit_recovery_terms.erl"},{line,126}]},{rabbit_recovery_terms,init,1,[{file,"src/rabbit_recovery_terms.erl"},{line,107}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]},{child,undefined,rabbit_recovery_terms,{rabbit_recovery_terms,start_link,[]},transient,30000,worker,[rabbit_recovery_terms]}}}},[{rabbit_queue_index,start,1,[{file,"src/rabbit_queue_index.erl"},{line,491}]},{rabbit_variable_queue,start,1,[{file,"src/rabbit_variable_queue.erl"},{line,466}]},{rabbit_priority_queue,start,1,[{file,"src/rabbit_priority_queue.erl"},{line,92}]},{rabbit_amqqueue,recover,0,[{file,"src/rabbit_amqqueue.erl"},{line,240}]},{rabbit,recover,0,[{file,"src/rabbit.erl"},{line,800}]},{rabbit_boot_steps,'-run_step/2-lc$^1/1-1-',1,[{file,"src/rabbit_boot_steps.erl"},{line,49}]},{rabbit_boot_steps,run_step,2,[{file,"src/rabbit_boot_steps.erl"},{line,49}]},{rabbit_boot_steps,'-run_boot_steps/1-lc$^0/1-0-',1,[{file,"src/rabbit_boot_steps.erl"},{line,26}]}]}}} init terminating in do_boot () Crash dump is being written to: erl_crash.dump...done
解决办法:
find / -name recovery.dets
然后使用 rm 命令删除掉 recoer.dets 文件
问题3:
使用命令
rabbitmq-server start
报错如下: 提示 no space left on device
/usr/lib/rabbitmq/bin/rabbitmq-server: line 51: echo: write error: No space left on device Failed to write pid file: /var/lib/rabbitmq/mnesia/rabbit@n3.pid
解决办法:
查看磁盘占用情况
df -h
然后使用
cd / #回到根目录 du -sh * # 查看各个文件夹占用磁盘情况
然后看哪个盘数据多, 就cd 进入哪个盘,然后进行最终找到数据量大的文件。一般是日志文件的话,删除即可。