Search code examples
linuxrabbitmqapp-configconfiguration-files

rabbitmq - custom config file - disk_free_limit not set properly


I've properly install (rpm based) a rabbitmq cluster (with clusterer plugin) in rhel7, create the "custom" configuration files:

/etc/rabbitmq/rabbitmq-env.config => env varialble

/etc/rabbitmq/rabbitmq.config => rabbitmq properties

The rabbitmq cluster works fine exept that my parameters are ignored, any idea why?

Thanks in advance for you help

kr,

O.

nb: if I set the paramertesr myself with a command like:

rabbitmqctl set_disk_free_limit "1g"

for the disk limit for example, it works but I want them to survive a "reboot" :/

Here are my configurations files:

# /etc/rabbitmq/rabbitmq-env.config
(..)
NODE_PORT=5672
NODENAME=rabbit@node1
RABBITMQ_CONFIG_FILE=/etc/rabbitmq/rabbitmq.config
(..)


cat << EOF > /etc/rabbitmq/rabbitmq.config
[
{kernel, [
     ]},
{rabbit, [
    {cluster_nodes, ["rabbit@node1", "rabbit@node2", "rabbit@node3"], disc}
    {tcp_listeners, [5672]},
    {disk_free_limit, "1GB"},
    {collect_statistics_interval, 10000},
    {heartbeat, 30},
    {cluster_partition_handling, autoheal},
    {default_user, <<"guest">>},
    {default_pass, <<"guest">>}
    ]},

{rabbitmq_clusterer, [
    {config, [ {version,1}, {nodes,["rabbit@node1", "rabbit@node2", "rabbit@node3"]} ]}
    ]}
]
EOF

Solution

  • a little update for this topic, I had misconfigured my rabbitmq files; in order to have a working configuration, do the following modifications. kr, O.

    • For the environment file: we can get rid of the '.config' part in the file name as rabbitMQ add it anyway. I my log file, I Had an error with "... /etc/rabbitmq/rabbitmq.config.config ... "

    So keep the file with the .config extension (/etc/rabbitmq/rabbitmq.config) by set the env variable without the .config:

    (..)
    RABBITMQ_CONFIG_FILE=/etc/rabbitmq/rabbitmq
    (..)
    
    • For the rabbit.config file: As I used the clusterer plugins, we can get rid of the line cluster_nodes.

    Your file will look like this one:

    cat << EOF > /etc/rabbitmq/rabbitmq.config
    [
    {kernel, [
         ]},
    {rabbit, [
        {tcp_listeners, [5672]},
        {disk_free_limit, "1GB"},
        {collect_statistics_interval, 10000},
        {heartbeat, 30},
        {cluster_partition_handling, autoheal}
        ]},
    {rabbitmq_management, [
        {http_log_dir,"/myapps/myproject/rabbitmq/logs"},
        {listener, [{port, 15672 }]}
        ]},
    {rabbitmq_clusterer, [
        {config, [ {version,1}, {nodes,["rabbit@node01", "rabbit@node02", "rabbit@node03"]} ]}
        ]}
    ].
    EOF
    

    To verify your current config for the clusterer plugin you can use:

     rabbitmqctl eval 'rabbit_clusterer:status().'