How to reload RabbitMQ config file changes without restarting RabbitMQ node

10,797 views
Skip to first unread message

Anu

unread,
Mar 24, 2017, 9:21:53 PM3/24/17
to rabbitmq-users
Hi All,

In our RabbitMQ implementation, we share the same virtual host with many applications. So that they do not step on each other's queues and exchanges, we manage their permissions in the rabbitmq node's config file using the LDAP plugin. But whenever we have to make a change to the config file, we have to restart the RabbitMQ node to get the changes into effect. This causes downtime for all the applications.

Is there a way to just reload just the config file without restarting RabbitMQ node? I tried the "reload" option in the rabbitmq-server command, but it also does not help.

Please let me know if you need any further information to answer this.

Thanks,
Anu

Michael Klishin

unread,
Mar 25, 2017, 3:42:10 AM3/25/17
to rabbitm...@googlegroups.com
By far the easiest option is to use `rabbitmqctl eval`. What key do you need to set and to what value?

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Dmitriy Stepanenko

unread,
Dec 18, 2017, 3:37:03 AM12/18/17
to rabbitmq-users
Good time of day,

Please excuse me for reviving such an old thread. But I also want to know how to set a specific config parameter dynamically (and without learning much Erlang and RabbitMQ internals).

Suppose, I want to set a "rabbit.mnesia_table_loading_retry_timeout" parameter to  90000. What Erlang expression should I evaluate?

And I hope that if I would like then to set, for example, "mnesia_table_loading_retry_limit" to 3, I could use the same expression, just with a key and a value replaced with new ones?

суббота, 25 марта 2017 г., 9:42:10 UTC+2 пользователь Michael Klishin написал:
By far the easiest option is to use `rabbitmqctl eval`. What key do you need to set and to what value?
On Sat, Mar 25, 2017 at 4:21 AM, Anu <anurag.shri...@gmail.com> wrote:
Hi All,

In our RabbitMQ implementation, we share the same virtual host with many applications. So that they do not step on each other's queues and exchanges, we manage their permissions in the rabbitmq node's config file using the LDAP plugin. But whenever we have to make a change to the config file, we have to restart the RabbitMQ node to get the changes into effect. This causes downtime for all the applications.

Is there a way to just reload just the config file without restarting RabbitMQ node? I tried the "reload" option in the rabbitmq-server command, but it also does not help.

Please let me know if you need any further information to answer this.

Thanks,
Anu

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Dec 18, 2017, 3:55:48 AM12/18/17
to rabbitm...@googlegroups.com
Both rabbit.mnesia_table_loading_retry_timeout and rabbit.mnesia_table_loading_retry_limit are only
used when a node starts. It makes no sense to set them at runtime as that wouldn't make any difference.

Nonetheless, here's how you do it:

# first see the effective value
rabbitmqctl eval 'application:get_env(rabbit, mnesia_table_loading_retry_timeout).'
# => {ok,90000}
rabbitmqctl eval 'application:set_env(rabbit, mnesia_table_loading_retry_timeout, 90000).'
# => ok

# make sure the change had the effect we expect
rabbitmqctl eval 'application:get_env(rabbit, mnesia_table_loading_retry_timeout).'
# => {ok,90000}

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dmitriy Stepanenko

unread,
Dec 18, 2017, 4:49:56 AM12/18/17
to rabbitmq-users
Thank you,

понедельник, 18 декабря 2017 г., 10:55:48 UTC+2 пользователь Michael Klishin написал:
Both rabbit.mnesia_table_loading_retry_timeout and rabbit.mnesia_table_loading_retry_limit are only
used when a node starts. It makes no sense to set them at runtime as that wouldn't make any difference.

Really, you are right :-)
I just took the parameter I tried much to tweak attempting to solve my cluster startup problem.
But this will be another thread. Gone to open it.
понедельник, 18 декабря 2017 г., 10:55:48 UTC+2 пользователь Michael Klishin написал:
Message has been deleted

Anurag

unread,
Dec 3, 2018, 6:50:49 PM12/3/18
to rabbitmq-users
Hi Michael,

Sorry to initiate this old thread again and so late after your initial response.

I need to change the following LDAP related section in the "advanced.config" file frequently and hence, would like to understand how can I have rabbitmq server reload this without a restart. I am not versed with erlang hence unable to create a rabbitmq eval expression for this. Can you please take a look and see if this is even possible?

Please let me know if there is any other information you need from my side to answer this.

Thanks !

[
{rabbitmq_auth_backend_ldap,
   [
    {tag_queries,
    [
       {administrator, { 'or', [ 
{
match,
                              {attribute, "cn=rabbitmq,ou=grp,o=linux", "memberUid"},
                              {string, "${username}"}
},
{
match,
                              {attribute, "cn=rabbitmq1,ou=grp,o=linux", "memberUid"},
                              {string, "${username}"}
}
]
}
},
       {management,    
{constant, true}
}
    ]
}
].


On Saturday, March 25, 2017 at 12:42:10 AM UTC-7, Michael Klishin wrote:
By far the easiest option is to use `rabbitmqctl eval`. What key do you need to set and to what value?
On Sat, Mar 25, 2017 at 4:21 AM, Anu <anurag.shri...@gmail.com> wrote:
Hi All,

In our RabbitMQ implementation, we share the same virtual host with many applications. So that they do not step on each other's queues and exchanges, we manage their permissions in the rabbitmq node's config file using the LDAP plugin. But whenever we have to make a change to the config file, we have to restart the RabbitMQ node to get the changes into effect. This causes downtime for all the applications.

Is there a way to just reload just the config file without restarting RabbitMQ node? I tried the "reload" option in the rabbitmq-server command, but it also does not help.

Please let me know if you need any further information to answer this.

Thanks,
Anu

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Dec 3, 2018, 6:51:01 PM12/3/18
to rabbitm...@googlegroups.com
There is no way to reload configuration without node restart. Also, not all
configuration changes can be applied at runtime in general (although LDAP queries likely can).

On Tue, Dec 4, 2018 at 2:48 AM Anurag <anurag.c...@gmail.com> wrote:
Hi Michael,

Sorry to initiate this old thread again and so late after your initial response.

I need to change the following LDAP related section in the "advanced.config" file frequently and hence, would like to understand how can I have rabbitmq server reload this without a restart. I am not versed with erlang hence unable to create a rabbitmq eval expression for this. Can you please take a look and see if this is even possible?

Please let me know if there is any other information you need from my side to answer this.

Thanks !

[
{rabbitmq_auth_backend_ldap,
   [
    {tag_queries,
    [
       {administrator, { 'or', [ 
{
match,
                              {attribute, "cn=rabbitmq,ou=grp,o=linux", "memberUid"},
                              {string, "${username}"}
},
{
match,
                              {attribute, "cn=rabbitmq1,ou=grp,o=linux", "memberUid"},
                              {string, "${username}"}
}
]
}
},
       {management,    
{constant, true}
}
    ]
    },
    {vhost_access_query,    
    {
    'and', [
    {
    match,
    {attribute, "cn=rabbitmq,ou=grp,o=linux", "memberUid"},
            {string, "${username}"}     
    },
    {
    equals,"${vhost}", "systest"
    }
    ]
    }
    },
    {resource_access_query,
      {
      for, [{resource, exchange,
                {for, [
                {permission, configure,
                {
                'and',
                [
                        {match,
                            {attribute, "cn=rabbitmq,ou=grp,o=linux", "memberUid"},
                            {string, "${username}"}
                          },
                          {
                          match,
                            {string, "${name}"},
                            {string, "^EXCH.MNO."}
                          }
                          ]
                          }
                        },
                          {permission, write,
                            {
                                'and',
                [
                        {match,
                            {attribute, "cn=appgrp,ou=grp,o=linux", "memberUid"},
                            {string, "${username}"}
                          },
                          {
                          match,
                            {string, "${name}"},
                            {string, "^EXCH.MNO."}
                          }
                          ]
                            }
                          },
                          {permission, read,  {constant, true}}
                        ]
                    }
               },
   {resource, queue,
                {for, [
                {permission, configure,
                {
                'and',
                [
                        {match,
                            {attribute, "cn=appgrp,ou=grp,o=linux", "memberUid"},
                            {string, "${username}"}
                          },
                          {
                          match,
                            {string, "${name}"},
                            {string, "^Q.MNO."}
                          }
                          ]
                          }
                        },
                          {permission, write,
                            {
                                'and',
                [
                        {match,
                            {attribute, "cn=rabbitmq,ou=grp,o=linux", "memberUid"},
                            {string, "${username}"}
                          },
                          {
                          match,
                            {string, "${name}"},
                            {string, "^Q.MNO."}
                          }
                          ]
                            }
                          },
                          {permission, read,  {constant, true}}
                        ]
                    }
               }               
    ]
      }
    },
    {topic_access_query,
      {for, [{permission, write, 
      {
      'and',
                [
      {
      match, 
      {string, "${routing_key}"}, 
      {string, "^a"}
      },
      {
      match,
                        {attribute, "cn=appgrp,ou=grp,o=linux", "memberUid"},
                        {string, "${username}"}
                      },
                      {
                      match,
                        {string, "${name}"},
                        {string, "^EXCH.MNO."}
                      }
      ]
      }
      },
             {permission, read,  {constant, true}}
            ]
      }
    }
  ]
}
].



On Saturday, March 25, 2017 at 12:42:10 AM UTC-7, Michael Klishin wrote:
By far the easiest option is to use `rabbitmqctl eval`. What key do you need to set and to what value?
On Sat, Mar 25, 2017 at 4:21 AM, Anu <anurag.shri...@gmail.com> wrote:
Hi All,

In our RabbitMQ implementation, we share the same virtual host with many applications. So that they do not step on each other's queues and exchanges, we manage their permissions in the rabbitmq node's config file using the LDAP plugin. But whenever we have to make a change to the config file, we have to restart the RabbitMQ node to get the changes into effect. This causes downtime for all the applications.

Is there a way to just reload just the config file without restarting RabbitMQ node? I tried the "reload" option in the rabbitmq-server command, but it also does not help.

Please let me know if you need any further information to answer this.

Thanks,
Anu

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Anurag

unread,
Dec 3, 2018, 6:59:40 PM12/3/18
to rabbitmq-users
Thanks Michael for the prompt response !

Sorry, I am a bit confused here ... On the one hand you are saying that the configuration cannot be reloaded without restart, but then you are saying that LDAP queries can likely be changed in runtime.

Does it mean that LDAP query configuration mentioned in the config can be changed on runtime? If yes, can you please provide an example command?

Thanks,
Anurag

Michael Klishin

unread,
Dec 3, 2018, 7:44:48 PM12/3/18
to rabbitm...@googlegroups.com
I was saying that even if there was a way to reload the config, some changes cannot be applied retroactively.
You cannot reload at runtime. Individual settings can be set using `rabbitmqctl eval` but it is only really
practical for settings that are not deeply nested (so, not LDAP queries) and would have an effect at runtime.

Anurag Shrivastava

unread,
Dec 3, 2018, 8:19:45 PM12/3/18
to rabbitm...@googlegroups.com
This makes sense ... While researching the "rabbitmqctl eval" expression, I also felt that its not possible to set LDAP configuration as it can get too complex and nested.

Thanks again for the help ! 
Reply all
Reply to author
Forward
0 new messages