如何设置RabbitMQ目录的权限来创建新文件?

时间:2016-07-14 17:23:09

标签: unix ubuntu rabbitmq ubuntu-14.04 ubuntu-server

我想将RABBITMQ_BASE文件移至" / opt / rabbitmq"

我尝试过以下操作,但似乎我在某处犯了错误:

RABBITMQ_BASE=/opt/rabbitmq
export RABBITMQ_NODENAME=rabbit@localhost
export RABBITMQ_NODE_IP_ADDRESS=127.0.0.1
export ERL_EPMD_ADDRESS=127.0.0.1
export RABBITMQ_MNESIA_BASE=/opt/rabbitmq/MNESIA

这是我的rabbitmq-env.conf的内容

BOOT FAILED
===========

Error description:
   {error,{cannot_create_mnesia_dir,"/opt/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,505}]},
    {rabbit_node_monitor,prepare_cluster_status_files,0,
                         [{file,"src/rabbit_node_monitor.erl"},{line,101}]},
    {rabbit,'-boot/0-fun-0-',0,[{file,"src/rabbit.erl"},{line,270}]},
    {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,403}]},
    {init,start_it,1,[]},
    {init,start_em,1,[]}]

{"init terminating in do_boot",{error,{cannot_create_mnesia_dir,"/opt/rabbitmq/MNESIA/rabbit@localhost/",eacces}}}

我检查了/ var / log / rabbitmq / startup_log中的日志:

ubuntu root@/opt $ ls -lah
total 48K
drwx------ 10      700 root     4.0K Jul 14 12:42 .
drwx------  5      700 root     4.0K Jul 14 10:39 ..
drwx------ 13      700 root     4.0K Jul 12 10:16 anaconda
drwx------  4      700 root     4.0K Jul 12 09:28 data
drwx------  3      700 root     4.0K Jul 12 10:38 legacy
drwx------  2      700 root      12K Jul 14 12:45 logs
drwx------  3      700 root     4.0K Jul 12 09:47 mongodb
drwxrw-rw-  4 rabbitmq rabbitmq 4.0K Jul 14 13:05 rabbitmq

" / opt" directory由root拥有,但其他目录的权限如下:

initial-scale=0

1 个答案:

答案 0 :(得分:0)

适用于我的解决方案是禁用SELINUX