13

I have rabbitmq-server installed from the system package on Ubuntu 12, and no matter what I do it seems to ignore any configuration file.

Everything on the web says the server looks for /etc/rabbitmq/rabbitmq.conf, but even if I create that file the server reports no config:

> /usr/sbin/rabbitmq-server 

node           : rabbit@ip-10-160-149-160
app descriptor : /usr/lib/rabbitmq/lib/rabbitmq_server-2.7.1/sbin/../ebin/rabbit.app
home dir       : /var/lib/rabbitmq
config file(s) : (none)

I tried setting RABBITMQ_CONFIG_FILE to point to that file, but that has no effect.

Fwiw, my rabbitmq-env.conf seems to want to source scripts from /etc/rabbitmq.conf.d, but these appear to be expected to be bash scripts, not Erlang config.

Tamara Koliada
  • 1,200
  • 2
  • 14
  • 31
Scott Persinger
  • 3,554
  • 2
  • 20
  • 12
  • I tried setting CONFIG_FILE in rabbitmq-env.conf to no avail, although setting NODENAME in that file did work, so the server is reading the env file. I tried both "CONFIG_FILE" (correct) and "RABBITMQ_CONFIG_FILE". Neither one has any effect. – Scott Persinger Sep 25 '12 at 18:50

7 Answers7

15

I finally had some luck by just removing /etc/rabbitmq/rabbitmq-env.conf altogether. I also noticed that the erlang config is rabbitmq.config and not 'conf', although fixing that still didn't fix the problem.

Removing rabbitmq-env.conf at least allows the server to find rabbitmq.config. Good lord, what a mess.

Tamara Koliada
  • 1,200
  • 2
  • 14
  • 31
Scott Persinger
  • 3,554
  • 2
  • 20
  • 12
  • Also running 2.7.1 (via apt-get) for quick testing. Found this comment helpful, although others may run into other trouble (like "guest" not having permissions for the default vhost). – Greg M. Krsak Oct 08 '12 at 07:32
12

Setting RABBITMQ_CONFIG_FILE works, but you are supposed to set it to the filename without the .config extension! That means the actual file must have the extension .config.

I wasted quite a lot of time today to figure this out.

Hongli
  • 18,682
  • 15
  • 79
  • 107
  • worked here. rabbitmq v3.6.1. Also after doing that, you need to do `sudo service rabbitmq-server restart` for those changes to take effect. and if you're making a config file for the first time for rabbitmq below v3.7.0, use this example config https://github.com/rabbitmq/rabbitmq-server/blob/v3.6.x/docs/rabbitmq.config.example – lasec0203 Jan 29 '18 at 00:58
6

1) RabbitMQ provides an example config file depending upon your distro you can find it in these directories,

  Generic UNIX - $RABBITMQ_HOME/etc/rabbitmq/
    Debian - /etc/rabbitmq/
    RPM - /etc/rabbitmq/
    Mac OS X (Macports) - ${install_prefix}/etc/rabbitmq/, the Macports prefix is usually /opt/local
    Windows - %APPDATA%\RabbitMQ\

2) To create a configuration file on debian I moved the example file to /etc/rabbitmq directory.

3) renamed rabbitmq.config.example to rabbitmq.config

4) In rabbitmq-env.conf assigned CONFIGFILE variable as a to the path above config file but without mentioning file extension(.config)

CONFIGFILE=/etc/rabbitmq/rabbitmq

5) Restarted the rabbitmq-server. On debian

sudo /etc/init.d/rabbitmq-server start
Sagar D
  • 111
  • 1
  • 2
4

I had success with putting the config in /etc/rabbitmq/rabbitmq.config. No need to remove /etc/rabbitmq/rabbitmq-env.conf.

RabbitMQ 2.7.1 on Ubuntu 12.04

millerdev
  • 10,011
  • 2
  • 31
  • 27
1

in sum 1.tylko rabbitmq.config file without rabbitmq-env.conf works, but need to reset the server: /etc/init.d/rabbitmq-server (start, stop), do not:   rabbitmqctl (stop_app, reset, start_app) 2 rabbitmq.config and rabbitmq-env.conf it may be, but: in RabbitMQ-env.conf must specify the path: CONFIG_FILE = /etc/rabbitmq/rabbitmq without config ext!

At least for me :) Debian 7.0 Rabbit 3.1 erl 1.15

muniek
  • 11
  • 1
  • Thanks. I was clear in the [config docs](https://www.rabbitmq.com/configure.html) that the env var value should exclude the config ext – Thanh Nguyen Aug 22 '14 at 17:44
0

in sum
1. Only rabbitmq.config file without rabbitmq-env.conf works, but need to reset the server: /etc/init.d/rabbitmq-server (start, stop), do not: rabbitmqctl (stop_app, reset, start_app)
2. rabbitmq.config and rabbitmq-env.conf it may be, but: in rabbitmq-env.conf must specify the path: CONFIG_FILE = /etc/rabbitmq/rabbitmq without config ext!

At least for me :) Debian 7.0 Rabbit 3.1 erl 1.15

muniek
  • 11
  • 1
0
  1. create rabbitmq-env.conf: echo CONFIG_FILE=/etc/rabbitmq/my-rabbitmq.conf > /etc/rabbitmq/rabbitmq-env.conf
  2. download systcl mode config file: wget https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/master/docs/rabbitmq.conf.example -O /etc/rabbitmq/my-rabbitmq.conf
  3. restart server: systemctl restart rabbitmq-server.service
  4. watch the log change: tail -n 50 /var/log/rabbitmq/rabbit@rabbitmq.log|head -n 20
  5. see the result my-rabbitmq.conf result

see more: https://www.rabbitmq.com/configure.html#customise-environment

lupguo
  • 1,525
  • 13
  • 13