При включении сервиса RabbitMQ появляется ошибка и не знаю в чем дело:
[root@localhost tmp]# sudo systemctl start rabbitmq-server
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 broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Пн 2022-11-21 11:09:43 MSK; 7s ago
Process: 32571 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 32571 (code=exited, status=1/FAILURE)
ноя 21 11:09:43 localhost.localdomain systemd[1]: Failed to start RabbitMQ broker.
ноя 21 11:09:43 localhost.localdomain systemd[1]: Unit rabbitmq-server.service entered failed...e.
ноя 21 11:09:43 localhost.localdomain systemd[1]: rabbitmq-server.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Вывод после journalctl -xe:
-- Subject: Начинается запуск юнита rabbitmq-server.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Начат процесс запуска юнита rabbitmq-server.service.
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: ## ##
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: ## ## RabbitMQ 3.7.9. Copyright (C) 2007-2018 Pivotal Software, Inc.
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: ########## Licensed under the MPL. See http://www.rabbitmq.com/
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: ###### ##
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: ########## Logs: /var/log/rabbitmq/rabbit@localhost.log
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: /var/log/rabbitmq/rabbit@localhost_upgrade.log
ноя 21 11:11:50 localhost.localdomain rabbitmq-server[3833]: Starting broker...
ноя 21 11:11:52 localhost.localdomain rabbitmq-server[3833]: {"init terminating in do_boot",{undef,[{erlang,get_stacktrace,[],[]},{rabbit,boot_error,2,[{file,"src/rabbit.erl"},{line,877}]},{rab
ноя 21 11:11:52 localhost.localdomain rabbitmq-server[3833]: init terminating in do_boot ({undef,[{erlang,get_stacktrace,[],[]},{rabbit,boot_error,2,[{_},{_}]},{rabbit,start_it,1,[{_},{_}]},{in
ноя 21 11:11:52 localhost.localdomain rabbitmq-server[3833]: Crash dump is being written to: /var/log/rabbitmq/erl_crash.dump...done
ноя 21 11:11:52 localhost.localdomain systemd[1]: rabbitmq-server.service: main process exited, code=exited, status=1/FAILURE
ноя 21 11:11:52 localhost.localdomain systemd[1]: Failed to start RabbitMQ broker.
-- Subject: Ошибка юнита rabbitmq-server.service
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита rabbitmq-server.service.
--
-- Результат: failed.
ноя 21 11:11:52 localhost.localdomain systemd[1]: Unit rabbitmq-server.service entered failed state.
ноя 21 11:11:52 localhost.localdomain systemd[1]: rabbitmq-server.service failed.
Подскажите пожалуйста в чем проблема и как от нее избавиться.
Проблемы и решения в старте RabbitMQ
Вопрос 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/[email protected]/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/[email protected]
/var/log/rabbitmq/[email protected]
{"init terminating in do_boot",{could_not_start,rabbit,{{badmatch,{error,{{{badmatch,{error,{not_a_dets_file,"/var/lib/rabbitmq/mnesia/[email protected]/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
Вопрос 4:
Используйте команды
rabbitmq-server start
Сообщение об ошибке выглядит следующим образом: Запрашивать на устройстве не осталось места
/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/[email protected]
Решение:
Просмотр использования диска
df -h
Тогда используйте
cd / # Вернуться в корневой каталог
du -sh * # Просмотр использования диска каждой папкой
Затем посмотрите, на каком диске больше данных, и затем перейдите к тому диску, на который входит компакт-диск, а затем перейдите к поиску файла с наибольшим объемом данных. Если это файл журнала, удалите его.
Ненормальное начало
rabbitmq-server start
Ошибка сообщается следующим образом:
BOOT FAILED
===========
Error description:
{error,{inconsistent_cluster,"Node [email protected] thinks it's clustered with node [email protected], but [email protected] disagrees"}}
Log files (may contain more information):
/usr/local/rabbitmq_server-3.6.2/var/log/rabbitmq/[email protected]
/usr/local/rabbitmq_server-3.6.2/var/log/rabbitmq/[email protected]
Stack trace:
[{rabbit_mnesia,check_cluster_consistency,0,
[{file,"src/rabbit_mnesia.erl"},{line,593}]},
{rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,279}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,407}]},
{init,start_it,1,[]},
{init,start_em,1,[]}]
{"init terminating in do_boot",{error,{inconsistent_cluster,"Node [email protected] thinks it's clustered with node [email protected], but [email protected] disagrees"}}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
Как решить
Анализ проблемы, судя по ошибке запуска узла 1, кажется, что информация о кластере остается. Выполните действие на узле 2, чтобы удалить узел 1 из кластера, служба rabbitmq узла 1 не работает, поэтому база данных не может быть обновлена синхронно, информация о старом кластере все еще записывается (собственный узел в записи базы данных по-прежнему принадлежит кластеру), а база данных узлов 2 и узла 3 Запись была обновлена (кластер не содержит узел 1 в информации базы данных).
Затем вы должны удалить данные Mnesia этого узла
Найти каталог mnseia
mv mnesia/ /tmp/
Если он удален, обнаруживается, что автозагрузка все еще сообщает об ошибке, вполне вероятно, что вы удалили ошибку mnesia
find / -name mnesia
Найдите, затем удалите его и перезапустите
Проблема: после присоединения узла к кластеру появляется желтое поле
Решение:
rabbitmq-plugins enable rabbitmq_management
Добавляйте пользователей и назначайте роли
rabbitmqctl add_user root root
rabbitmqctl set_user_tags root administrator
проблема:
Если узел запускается
rabbitmq-server start
Ошибка сообщается следующим образом:
BOOT FAILED
===========
Timeout contacting cluster nodes: [[email protected]].
BACKGROUND
==========
This cluster node was shut down while other nodes were still running.
To avoid losing data, you should start the other nodes first, then
start this one. To force this node to start, first invoke
"rabbitmqctl force_boot". If you do so, any changes made on other
cluster nodes after this one was shut down may be lost.
DIAGNOSTICS
===========
attempted to contact: [[email protected]]
[email protected]:
* connected to epmd (port 4369) on node2
* node [email protected] up, 'rabbit' application running
current node details:
- node name: [email protected]
- home dir: /root
- cookie hash: jIUJ2lMKMbDhJLdCJgFDAA==
{"init terminating in do_boot",timeout_waiting_for_tables}
Решение:
rabbitmqctl force_boot
проблема:
rabbitmq-server: unrecognized service
Решение:
hostname
Проверьте правильность имени хоста
Если вы используете
vi /etc/hosts
Хост изменен, но не вступает в силу, затем проверьте
/etc/sysconfig/network
Является ли имя хоста в этом каталоге мертвым, измените его и перезагрузите
https://img-blog.csdn.net/20180322135423539
начало nohup
nohup ./rabbitmq-server start &
An issue seen when working with a customer is that rabbitMQ was «exiting» upon startup.
service rabbitmq-server stop — stop the service
service rabbitmq-server start — start the service
service rabbitmq-server status — verify rabbitmq is working properly
Error code seen critical information found in BOLD
expedition@Expedition:~$ service rabbitmq-server status
● rabbitmq-server.service — RabbitMQ broker
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2020-04-14 14:07:19 CDT; 380ms ago
Process: 85685 ExecStop=/bin/sh -c while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
Process: 85538 ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop (code=exited, status=0/SUCCESS)
Process: 85164 ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server (code=exited, status=1/FAILURE)
Main PID: 85164 (code=exited, status=1/FAILURE)
Status: «Exited.»
Apr 14 14:07:19 Expedition systemd[1]: Failed to start RabbitMQ broker.
Apr 14 14:07:19 Expedition systemd[1]: rabbitmq-server.service: Unit entered failed state.
Apr 14 14:07:19 Expedition systemd[1]: rabbitmq-server.service: Failed with result ‘exit-code’.
expedition@Expedition:~$
We attempted to restart the server and service multiple times however the service was never able to properly run, so a netstat was run to verify that there is not another service running on the rabbitmq service port and preventing it from running. (Default rabbitmq port = 5672) generally found within the rabbitmq.conf file.
Solution:
sudo service mysql stop
sudo service rabbitmq-server stop
A separate folder was created and we moved the files from ( var/lib/rabbitmq/ ) into that temporary folder after the service was stopped.
sudo service mysql start
sudo service rabbitmq-server start
We first ran a restart of rabbitmq after moving the files into the temporary folder and verified it worked properly. After this verification we moved it back into the correct path and this resolved the issue.
service rabbitmq-server status — to verify the service is properly running.
I believe this should resolve issues seen with rabbitmq, which affects the panordersreaders (Jobs and Task Manager) on the expedition dashboard.
Special thanks to @alestevez for his assistance in finding a resolution to this issue!