might_not_write_file cluster_nodes.config etxtbsy

时间:2019-01-09 10:58:06

标签: docker rabbitmq

我在Windows Server 2012上使用Docker Toolbox。我的run_docker脚本:

docker run --rm -p 5050:5050 -p 49555:5555 -p 15672:15672 -m 3G -v /c/Users/Administrator/services/ndvi-service/logs:/home/ndvi_logs -v /c/Users/Administrator/services/ndvi-service/rabbitmq:/var/lib/rabbitmq/mnesia -h ndvi -td ndvi > container_id

但是启动RabbitMQ时出现错误:

root@ndvi:/# cat /var/log/rabbitmq/startup_err
init terminating in do_boot ({error,could_not_write_file,/var/lib/rabbitmq/mnesia/rabbit@ndvi/cluster_nodes.config,etxtbsy}})

当我从docker run中删除Rabbitmq的安装命令时,一切正常:

 docker run --rm -p 5050:5050 -p 49555:5555 -p 15672:15672 -m 3G -v /c/Users/Administrator/services/ndvi-service/logs:/home/ndvi_logs -h ndvi -td ndvi > container_id

我想挂载RabbitMQ文件夹以使其持久。

1 个答案:

答案 0 :(得分:0)

我可以手动创建卷:

docker volume create my-vol

使用my-vol,mount命令将非常有用:

docker run --rm -p 5050:5050 -p 49555:5555 -p 15672:15672 -m 3G -v /c/Users/Administrator/services/ndvi-service/logs:/home/ndvi_logs -v my-vol:/var/lib/rabbitmq/mnesia -h ndvi -td ndvi > container_id