Search code examples
erlangrabbitmq

Failed to Create Cookie file RabbitMQ in Windows


I am trying to run the following command

rabbitmq-plugins.bat enable rabbitmq_management  

and its giving me an error like this:

11:36:55.464 [error] Failed to create cookie file 'h:/.erlang.cookie': enoent

I am using windows 7, Erlang Version R16B01 and RabbitMQ-Server version 3.1.5

I am using my work PC and our Corporate policy sets the HOMEDRIVE to h: and HOMEPATH to / and i dont think they will let me change this.

I can see the .erlang.cookie file under C:\Windows.

Could someone let me know of a workaround for this ?

Thanks in advance !


Solution

  • Set the home drive to some dir in the dos shell before executing the cli.

    Create a startup file, e.g start-rabbit.bat, with contents below.

    set HOMEDRIVE=C:/conf/rabbitmq :: Or your favorite dir 
    
    rabbitmq-plugins.bat enable rabbitmq_management
    

    Use a folder in C drive c:/conf/rabbitmq. The rabbitmq system will write the cookie file there.

    It is a good idea not to dirty rabbitmq-xxx.bat installed files.