RabbitMQ – action „start” failed

Problem

Podczas instalacji rabbitmq-server napotykam na problem, pakiet nie chce się do końca zainstalować:
Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_log, _err rabbitmq-server. invoke-rc.d: initscript rabbitmq-server, action "start" failed. dpkg: error processing rabbitmq-server (--configure): subprocess installed post-installation script returned error exit status 1 configured to not write apport reports Errors were encountered while processing: rabbitmq-server

Ponadto:
# invoke-rc.d rabbitmq-server start
Starting message broker: rabbitmq-serverFAILED - check /var/log/rabbitmq/startup_\{log, _err\} ... (warning).
failed!
invoke-rc.d: initscript rabbitmq-server, action "start" failed.

dmesg pokazuje:
[11300042.270119] erlexec[3446]: segfault at 4 ip 000076b83c0fcc96 sp 00007a1d47eae7d0 error 6 in libc-2.11.3.so[76b83c060000+159000]

strace:
[pid 5782] lstat("/sys", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
[pid 5782] lstat("/sys/devices", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
[pid 5782] lstat("/sys/devices/system", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
[pid 5782] lstat("/sys/devices/system/node", {st_mode=S_IFDIR|0700, st_size=0, ...}) = 0
[pid 5782] open("/sys/devices/system/node", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
[pid 5782] --- SIGSEGV (Segmentation fault) @ 0 (0) ---

# ls -al /sys/devices/system/node
pokazuje uprawnienia 700

Naprawa

Daje:
# chmod a+xw /sys/devices/system/node
# rm -rf /var/lib/rabbitmq/mnesia/

odpalam z roota
# /usr/lib/rabbitmq/bin/rabbitmq-server
# invoke-rc.d rabbitmq-server start
Starting message broker: rabbitmq-serverFAILED - check /var/log/rabbitmq/startup_\{log, _err\} ... (warning).
failed!
invoke-rc.d: initscript rabbitmq-server, action "start" failed.

# ls /var/log/rabbitmq/startup_*
startup_err startup_log
# cat /var/log/rabbitmq/startup_*

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
BOOT FAILED
===========

Error description:
{error,{could_not_write_file,"/var/lib/rabbitmq/mnesia/rabbit@mephisto/cluster_nodes.config",
eacces}}

Log files (may contain more information):
/var/log/rabbitmq/rabbit@mephisto.log
/var/log/rabbitmq/rabbit@mephisto-sasl.log

Stack trace:
[{rabbit_node_monitor,write_cluster_status,1},
{rabbit_node_monitor,prepare_cluster_status_files,0},
{rabbit,'-boot/0-fun-1-',0},
{rabbit,start_it,1},
{init,start_it,1},
{init,start_em,1}]

{"init terminating in do_boot",{rabbit,failure_during_boot,{error,{could_not_write_file,"/var/lib/rabbitmq/mnesia/rabbit@mephisto/cluster_nodes.config",eacces}}}}

Zmieniam uprawnienia:
# chown rabbitmq:rabbitmq /var/lib/rabbitmq/ -R

Uruchamiam:
# invoke-rc.d rabbitmq-server start
Starting message broker: rabbitmq-server.

Test

# ps aux | grep rabbit
rabbitmq 14638 0.0 0.0 11748 1384 ? S 20:08 0:00 /bin/sh /usr/sbin/rabbitmq-server
rabbitmq 14648 5.7 0.2 142460 34276 ? Sl 20:08 0:00 /usr/lib/erlang/erts-5.8/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.1.5/sbin/../ebin -noshell -noinput -s rabbit boot -sname rabbit@mephisto -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@mephisto.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@mephisto-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.1.5/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@mephisto-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@mephisto"

# invoke-rc.d rabbitmq-server status
Status of node rabbit@mephisto ...
[{pid,14648},
{running_applications,[{rabbit,"RabbitMQ","3.1.5"},
{os_mon,"CPO CXC 138 46","2.2.5"},
{xmerl,"XML parser","1.2.5"},
{mnesia,"MNESIA CXC 138 12","4.4.14"},
{sasl,"SASL CXC 138 11","2.1.9.2"},
{stdlib,"ERTS CXC 138 10","1.17"},
{kernel,"ERTS CXC 138 10","2.14"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R14A (erts-5.8) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:30] [kernel-poll:true]\n"},
{memory,[{total,28874312},
{connection_procs,2712},
{queue_procs,5424},
{plugins,0},
{other_proc,9018160},
{mnesia,59648},
{mgmt_db,0},
{msg_index,34208},
{other_ets,792096},
{binary,1848},
{code,15563458},
{atom,1351233},
{other_system,2045525}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,6707676774},
{disk_free_limit,1000000000},
{disk_free,6399975424},
{file_descriptors,[{total_limit,924},
{total_used,3},
{sockets_limit,829},
{sockets_used,1}]},
{processes,[{limit,1048576},{used,129}]},
{run_queue,0},
{uptime,435}]
...done.

 

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *