环境变量中的RabbitMQ日志和Mnesia位置没有反射(reflect)?

标签 rabbitmq rabbitmqctl

我想将 Rabbitmq MNESIA 目录更改为 /disk文件夹而不是默认 /var/lib .我在 /usr/lib/rabbitmq/bin 中做了更改在 rabbitmq-env

RABBITMQ_MNESIA_BASE=/disk/rabbitmq/
RABBITMQ_LOG_BASE=/disk/rabbitmq/log/

并在重新启动它后
service rabbitmq-server restart
Restarting rabbitmq-server (via systemctl):                [  OK  ]

但是当我检查状态时
      >      service rabbitmq-server status 
WARNING: Removing trailing slash from RABBITMQ_MNESIA_BASE
WARNING: Removing trailing slash from RABBITMQ_MNESIA_BASE
Status of node 'rabbit@ip-10-03-209-294' ...
Error: unable to connect to node 'rabbit@ip-10-03-209-294': nodedown

DIAGNOSTICS
===========

attempted to contact: ['rabbit@ip-10-03-209-294']

rabbit@ip-10-03-209-294:
  * connected to epmd (port 4369) on ip-10-03-209-294
  * epmd reports: node 'rabbit' not running at all
                  no other nodes on ip-10-03-209-294
  * suggestion: start the node

current node details:
- node name: 'rabbitmq-cli-61@10-03-209-294'
- home dir: /var/lib/rabbitmq
- cookie hash: D1JxYyl9vuDgVmH5K4dGyQ==

删除所有更改后,它工作正常。但我希望 MNESIA 目录为/disk。我也重新启动了实例。

最佳答案

尝试执行以下步骤:

  • /etc/init.d/rabbitmq-server stop
  • nano /etc/rabbitmq/rabbitmq-env.conf并添加:

    RABBITMQ_MNESIA_BASE=/disk/rabbitmq
    RABBITMQ_LOG_BASE=/disk/rabbitmq/log
  • chown rabbitmq:rabbitmq /disk/(and all subdirs)
  • /etc/init.d/rabbitmq-server start
  • service rabbitmq-server status

  • 刚刚在我的 debian 上试过:
    root@bae18650cea4:/# service rabbitmq-server status
    Status of node rabbit@bae18650cea4 ...
    [{pid,15240},
     {running_applications,[{rabbit,"RabbitMQ","3.6.2"},
                            {mnesia,"MNESIA  CXC 138 12","4.13.3"},
                            {os_mon,"CPO  CXC 138 46","2.4"},
                            {rabbit_common,[],"3.6.2"},
                            {xmerl,"XML parser","1.3.10"},
                            {ranch,"Socket acceptor pool for TCP protocols.",
                                   "1.2.1"},
                            {sasl,"SASL  CXC 138 11","2.7"},
                            {stdlib,"ERTS  CXC 138 10","2.8"},
                            {kernel,"ERTS  CXC 138 10","4.2"}]},
     {os,{unix,linux}},
     {erlang_version,"Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:64] [kernel-poll:true]\n"},
     {memory,[{total,139371632},
              {connection_readers,0},
              {connection_writers,0},
              {connection_channels,0},
              {connection_other,0},
              {queue_procs,2592},
              {queue_slave_procs,0},
              {plugins,0},
              {other_proc,18525024},
              {mnesia,58264},
              {mgmt_db,0},
              {msg_index,41880},
              {other_ets,920384},
              {binary,19128},
              {code,19777571},
              {atom,752537},
              {other_system,99274252}]},
     {alarms,[]},
     {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
     {vm_memory_high_watermark,0.4},
     {vm_memory_limit,839966720},
     {disk_free_limit,50000000},
     {disk_free,17685676032},
     {file_descriptors,[{total_limit,1048476},
                        {total_used,2},
                        {sockets_limit,943626},
                        {sockets_used,0}]},
     {processes,[{limit,1048576},{used,137}]},
     {run_queue,0},
     {uptime,399},
     {kernel,{net_ticktime,60}}]
    root@bae18650cea4:/#
    

    关于环境变量中的RabbitMQ日志和Mnesia位置没有反射(reflect)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37791757/

    相关文章:

    rabbitmq - 无法对节点rabbitmq执行操作

    java - pythonrabbitmqadmin listqueues命令虽然存在消息但无法获取消息内容

    ruby - 使用 bunny gem,如何阻止直到收到消息或超时到期

    grails - 如何启动在 application.yml 中配置的 rabbitmq-native 消费者?

    docker - pika.exceptions.ConnectionClosed:与172.18.0.3:5672的连接失败:[Errno 111]连接被拒绝

    c# - RabbitMQ 和 C#

    rabbitmq - 如何使用 rabbitmqctl 创建交换

    rabbitmq 列出所有虚拟主机上的队列

    docker - 如何在远程计算机上运行rabbitmqctl命令?

    spring - 如何使用带有 Spring AMQP 和 Rabbit 的 Headers Exchange 过滤和路由消息?