rename_cluster_node command gives Error: :mnesia_dir_not_found in RabbitMQ v3.8.8.

490 views
Skip to first unread message

badrira...@gmail.com

unread,
Oct 1, 2020, 2:22:07 AM10/1/20
to rabbitmq-users
Hi Team,

RabbitMQ v3.8.8
Erlang v23.0
OS :Windows 10

  I am trying to rename the cluster using command executed  call rabbitmqctl.bat rename_cluster_node rabbit@OLD_NODENAME rabbit@NEW_NODENAME . but it is failing with the error  Error: :mnesia_dir_not_found

Steps followed :
1.  C:\Users\Administrator>cd C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin
2.  C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>net stop RabbitMQ /yes
        The following services are dependent on the RabbitMQ service.
       Stopping the RabbitMQ service will also stop these services.

       The RabbitMQ service is stopping..............
       The RabbitMQ service was stopped successfully.


3. C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>call rabbitmq-service.bat          remove
       C:\Data\erl11.0\erts-11.0\bin\erlsrv: Service RabbitMQ removed from system.

4. C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>echo 127.0.0.1  NEW_NODENAME>>c:\windows\system32\drivers\etc\hosts

5. C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>call rabbitmqctl.bat      rename_cluster_node rabbit@OLD_NODENAME rabbit@NEW_NODENAME
          Error: :mnesia_dir_not_found
      Arguments given:
           rename_cluster_node rabbit@OLD_NODENAME rabbit@NEW_NODENAME

          [1mUsage [0m

        rabbitmqctl [--node <node>] [--longnames] [--quiet] rename_cluster_node      <oldnode1>  <newnode1> [oldnode2] [newnode2] ...

C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>

Kindly help on this.

Regards,
Badri.


Luke Bakken

unread,
Oct 1, 2020, 11:25:31 AM10/1/20
to rabbitmq-users
Hi Badri,

You must rename the mnesia directory located in %AppData%\RabbitMQ\db. Search for directories that use the old node name, and update them.


Thanks,
Luke
Message has been deleted

badrira...@gmail.com

unread,
Oct 6, 2020, 12:13:48 AM10/6/20
to rabbitmq-users

Hi Luke,

   Thanks for the response.

        We are following the steps provided by you in a different conversation ( https://groups.google.com/g/rabbitmq-users/c/_wIbIOxCxxk/m/5ngUEh-tBAAJ ) and steps provided are available in the attachment named   windows-rename-node-transcript.txt.

 

The same steps are working from RabbitMQ v3.7.14 to RabbitMQ v3.8.3 but after that in RabbitMQ  v3.8.8 and v3.8.9 are giving me below error.

 C:\Data\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>call rabbitmqctl.bat      rename_cluster_node rabbit@OLD_NODENAME rabbit@NEW_NODENAME

          Error: :mnesia_dir_not_found

      Arguments given:

           rename_cluster_node rabbit@OLD_NODENAME rabbit@NEW_NODENAME

  [1mUsage [0m

  rabbitmqctl [--node <node>] [--longnames] [--quiet] rename_cluster_node      <oldnode1>  <newnode1> [oldnode2] [newnode2] ...


 I have done test of rename_cluster_node command on different combination of RabbitMQ and Erlang and below is the result.

 RABBITMQ VERSION      ERLANG VERSION      rename_cluster_node output

RMQ v3.8.9                          Erlang v23.0                          Failed

RMQ v3.8.8                          Erlang v23.0                          Failed

RMQ v3.8.8                          Erlang v21.3                        Failed

RMQ v3.8.3                         Erlang v21.3                         Success 

RMQ v3.8.3                         Erlang v23.0                         Success


Can you please suggest why this command is not working in RabbitMQ v3.8.8 and v3.8.9 ?

 Thanks & Regards,

Badri.

Luke Bakken

unread,
Oct 7, 2020, 9:48:43 AM10/7/20
to rabbitmq-users
Hello,

I have done test of rename_cluster_node command on different combination of RabbitMQ and Erlang and below is the result.

 RABBITMQ VERSION      ERLANG VERSION      rename_cluster_node output

RMQ v3.8.9                          Erlang v23.0                          Failed

RMQ v3.8.8                          Erlang v23.0                          Failed

RMQ v3.8.8                          Erlang v21.3                        Failed

RMQ v3.8.3                         Erlang v21.3                         Success 

RMQ v3.8.3                         Erlang v23.0                         Success


Can you please suggest why this command is not working in RabbitMQ v3.8.8 and v3.8.9

I can't because you have not provided a transcript of the exact commands you ran and their output. We don't have time to guess on this mailing list. If you can provide transcripts of what you ran in each scenario we could take the time to investigate and reproduce.

Thanks,
Luke 

badrira...@gmail.com

unread,
Oct 8, 2020, 7:02:03 AM10/8/20
to rabbitmq-users
Hi Luke,

  Please find attached RabbitMQ v3.8.3 working steps and  RabbitMQ v3.8.8 not working steps.
In both , we followed the same steps but its failing in v3.8.8 at rename_cluster_node command, 
Please let me know if you need any further information.


Thanks & Regards,
Badri.
windows-rename-node-transcript-RMQ3.8.8-Erlang23.0.txt
windows-rename-node-transcript -RMQ3.8.3-Erlang21.3.txt

Luke Bakken

unread,
Oct 8, 2020, 8:20:29 PM10/8/20
to rabbitmq-users
Hi Badri,

Thank you for the very detailed information! It turns out the command to rename cluster nodes is broken. I have opened an issue here:


It will be fixed in the next release, 3.8.10

Thanks,
Luke

badrira...@gmail.com

unread,
Oct 9, 2020, 12:08:52 AM10/9/20
to rabbitmq-users
Hi Luke,

Thanks for the support.

any expected date for RabbitMQ v3.8.10 release.

Thanks & regards,
Badri.

Luke Bakken

unread,
Oct 10, 2020, 2:38:31 PM10/10/20
to rabbitmq-users
Hello,
 
We don't have an expected release date. You may be able to work around the issue by setting some environment variables before executing rabbitmqctl.bat:

set RABBITMQ_MNESIA_BASE=%AppData%/RabbitMQ/db
set RABBITMQ_MNESIA_DIR=%AppData%/RabbitMQ/db/rabbit@HOSTNAME-mnesia
.\rabbitmqctl.bat rename_cluster_node rabbit@HOSTNAME rabbit@rabbit_fixedhost

Let me know if the above works for you.
Thanks,
Luke

badrira...@gmail.com

unread,
Oct 13, 2020, 2:57:37 AM10/13/20
to rabbitmq-users
Hi Luke,

   I have tried the work around you gave and the below error is observed.

       Error: :feature_flags_file_not_found.

below are the detailed steps and their output.

    set RABBITMQ_MNESIA_BASE  C:\Users\Administrator\AppData\Roaming\RabbitMQ\db
    set RABBITMQ_MNESIA_DIR  C:\Users\Administrator\AppData\Roaming\RabbitMQ\db\rabbit@HOSTNAME-mnesia 


    C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>net stop RabbitMQ /yes
             The RabbitMQ service is stopping.........
             The RabbitMQ service was stopped successfully.


    C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>call rabbitmq-service.bat remove
    C:\Program Files\erl-23.0\erts-11.0\bin\erlsrv: Service RabbitMQ removed from system.

     C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>echo 127.0.0.1   Fixed_HostName>>c:\windows\system32\drivers\etc\hosts

      C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.8\sbin>call rabbitmqctl.bat rename_cluster_node rabbit@HOSTNAME rabbit@Fixed_HostName
            Error: :feature_flags_file_not_found
                     Arguments given:
                               rename_cluster_node rabbit@HOSTNAME rabbit@Fixed_HostName

              [1mUsage [0m

                rabbitmqctl [--node <node>] [--longnames] [--quiet] rename_cluster_node <oldnode1> <newnode1> [oldnode2] [newnode2] ...


 Thanks & Regards,
Badri

Luke Bakken

unread,
Oct 13, 2020, 11:48:08 AM10/13/20
to rabbitmq-users
Hello,

You'll have to also set the RABBITMQ_FEATURE_FLAGS_FILE environment variable like this, after setting RABBITMQ_MNESIA_BASE:

set RABBITMQ_FEATURE_FLAGS_FILE=%RABBITMQ_MNESIA_BASE%\rabbit@HOSTNAME-feature_flags

Please let me know how this works.

Thanks,
Luke

badrira...@gmail.com

unread,
Oct 16, 2020, 7:23:04 AM10/16/20
to rabbitmq-users
Hi Luke,

     The work around you provided is working, However the older data is getting lost.

I have observed that in RabbitMQ v3.8.8  after running the rename_cluster_node command, The older data like Queues, exchanges and users which are created before calling rename_cluster_node commands are getting lost and which was not happing in v3.8.3  and older versions.

below are the steps performed.

step 1 :  Erlang 23.0 and RabbitMQ v3.8.8 installed.
step 2 :  Created Queues, Exchanges and Users.
Step 3 :  Delete guest user.
step4 :    run the rename cluster node commands.
step 5 :   After the server is up ,  I could see data is cleared and guest user is created again.

and I have compared the log of v3.8.3 and v3.8.8 after  run the rename_cluster_node command and found some difference in the attached file.

can you please check and confirm if this is also an issue in RabbitMQ v3.8.8 ?.
Log_differences.txt

Luke Bakken

unread,
Oct 16, 2020, 8:56:15 AM10/16/20
to rabbitmq-users
Hello,

You can see that the 3.8.8 node with the updated host name is not using the correct database directory -

c:/Users/Administrator/AppData/Roaming/RabbitMQ/db/rabbit@HOSTNAME-mnesia

I will have to find time to test my workaround. You may have to wait until 3.8.10 for the final fix.

Thanks,
Luke

badrira...@gmail.com

unread,
Oct 16, 2020, 10:44:22 AM10/16/20
to rabbitmq-users
Thanks Luke for the support.

I will wait for the update.

Thank you......

Luke Bakken

unread,
Oct 16, 2020, 4:59:10 PM10/16/20
to rabbitmq-users
Hello Badri,

The steps I provided work correctly in my Linux environment using RabbitMQ 3.8.8. I will test on Windows this Monday but I expect it to work there as well.

Could you please re-run your rename scenario using RabbitMQ 3.8.8? Capture all of the commands you run and their output.

Thanks
Luke

On Friday, October 16, 2020 at 4:23:04 AM UTC-7, badrira...@gmail.com wrote:
Hi Luke,

badrira...@gmail.com

unread,
Oct 19, 2020, 6:31:19 AM10/19/20
to rabbitmq-users
Hi Luke, 

I have re-run the commands you provided.
PFA the commands output.

windows-rename-node-transcript-RMQ3.8.8-Erlang23.0.txt

Luke Bakken

unread,
Oct 19, 2020, 1:51:34 PM10/19/20
to rabbitmq-users
Hi Badri,

There are a couple errors in the way you're going about the rename. Please see the attached file for a different series of commands to run. I have made comments.

Thanks,
Luke
windows-rename-node-commands.txt

badrira...@gmail.com

unread,
Oct 20, 2020, 5:44:37 AM10/20/20
to rabbitmq-users
Hi Luke,

The work around you provided with new series of commands is working fine.

Thanks for the great support.

Michael Klishin

unread,
Oct 20, 2020, 6:01:38 AM10/20/20
to rabbitmq-users
Thank you for reporting back to the list (and helping us discover this issue in the first place, of course).
Reply all
Reply to author
Forward
0 new messages