RabbitMQ log and Mnesia location in Environment variables not reflecting?

10,307

Solution 1

Try following these steps:

  1. /etc/init.d/rabbitmq-server stop
  2. nano /etc/rabbitmq/rabbitmq-env.conf and add:

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

  3. chown rabbitmq:rabbitmq /disk/(and all subdirs)

  4. /etc/init.d/rabbitmq-server start

  5. service rabbitmq-server status

Just tried on my 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:/#

Solution 2

Instead of these env variables

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

Try

MNESIA_BASE=/disk/rabbitmq/
LOG_BASE=/disk/rabbitmq/log/

This at least worked for me after I stopped and restarted.

Share:
10,307

Related videos on Youtube

Dileephell
Author by

Dileephell

Node.js Developer is here ...

Updated on June 04, 2022

Comments

  • Dileephell
    Dileephell almost 2 years

    I want to change the Rabbitmq MNESIA dir to /disk folder instead of default /var/lib. I did the change in /usr/lib/rabbitmq/bin at rabbitmq-env with

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

    And after restarting it with

    service rabbitmq-server restart
    Restarting rabbitmq-server (via systemctl):                [  OK  ]
    

    But when i check the status as

          >      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==
    

    After removing all the changes ,it is working fine.But i want the MNESIA dir to be /disk. I restarted the instance as well.

  • Dileephell
    Dileephell almost 8 years
    after doing step 4. it starts and if i am exiting using ctrl+c then it stops ? How can i overcome this ???
  • Gabriele Santomaggio
    Gabriele Santomaggio almost 8 years
    You shouldn't stop it, this happens if the directories don't have the right permission !
  • Dileephell
    Dileephell almost 8 years
    i just restarted it after many days,it went down and the data dir automatically gets changed to /var/lib/rabbitmq ???
  • Gabriele Santomaggio
    Gabriele Santomaggio almost 8 years
    "automatically gets changed" you maybe missed to set the enviroment variabiles. I think that it is not possible that RMQ changes the directory automatically