启动(docker run)rabbitmq图像会导致崩溃。 startup_err的内容:
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
startup_log
BOOT FAILED
===========
Error description:
{error,{cannot_create_mnesia_dir,"/var/lib/rabbitmq/mnesia/rabbit@localhost/",
eacces}}
Log files (may contain more information):
/var/log/rabbitmq/rabbit@localhost.log
/var/log/rabbitmq/rabbit@localhost-sasl.log
Stack trace:
[{rabbit_mnesia,ensure_mnesia_dir,0,
[{file,"src/rabbit_mnesia.erl"},{line,472}]},
{rabbit_node_monitor,prepare_cluster_status_files,0,
[{file,"src/rabbit_node_monitor.erl"},{line,99}]},
{rabbit,'-boot/0-fun-1-',0,[{file,"src/rabbit.erl"},{line,326}]},
{rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,354}]},
{init,start_it,1,[]},
{init,start_em,1,[]}]
{"init terminating in do_boot",{rabbit,failure_during_boot,{error, {cannot_create_mnesia_dir,"/var/lib/rabbitmq/mnesia/rabbit@localhost/",eacces}}}}
这是Dockerfile的rabbitmq部分:
RUN apt-get install rabbitmq-server -y
ENV RABBITMQ_CONFIG_FILE /etc/rabbitmq/rabbitmq
ADD rabbitmq.config /etc/rabbitmq/rabbitmq.config
# plugins --offline
RUN /usr/sbin/rabbitmq-plugins enable rabbitmq_management
RUN /usr/sbin/rabbitmq-plugins enable rabbitmq_shovel
RUN /usr/sbin/rabbitmq-plugins enable rabbitmq_shovel_management
EXPOSE 5672 15672 4369
VOLUME ["/var/log/rabbitmq", "/var/lib/rabbitmq/mnesia"]
这是docker run命令。 rabbitmqbase变量将值保存到要映射到卷的主机(我的OSX)目录。
fab.local('docker run -itd -h rabbithost -p 5672:5672 -p 15672:15672 -p 4369:4369 -p 9001:9001 -v {}/data/mnesia:/var/lib/rabbitmq/mnesia -v {}/data/log:/var/log/rabbitmq --name rabbitmq dtwill/rabbitmq'.format(rabbitmqbase, rabbitmqbase))
所以是的,它看起来像是一个权利问题......我不确定如何解决它。
[更新] 所以我认为它可能是-h param并尝试了boot2docker ip,localhost&将它们全部移除 - 仍然崩溃。
谢谢!