Scott Persinger
Scott Persinger

Reputation: 3564

Rabbitmq ignores configuration on Ubuntu 12

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.

Upvotes: 13

Views: 10200

Answers (7)

Scott Persinger
Scott Persinger

Reputation: 3564

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.

Upvotes: 15

lupguo
lupguo

Reputation: 1651

  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/[email protected]|head -n 20
  5. see the result my-rabbitmq.conf result

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

Upvotes: 0

Sagar D
Sagar D

Reputation: 111

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

Upvotes: 6

muniek
muniek

Reputation: 11

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

Upvotes: 0

muniek
muniek

Reputation: 11

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

Upvotes: 1

Hongli
Hongli

Reputation: 18944

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.

Upvotes: 12

millerdev
millerdev

Reputation: 10349

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

Upvotes: 4

Related Questions