Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Default 'home' Path in Erlang to Resolve RabbitMQ Start Up Error

I'm new to rabbitmq and by association new to erlang. I'm running into a problem where I cannot start rabbitmq as the 'home' location for the .erlang.cookie has been changed. I've run the command

init:get_argument(home).

which returns

{ok,[["H:\\"]]}

this is an issue, as this is a network drive I do not always have access to. I need to be able to change the 'home' directory to something local.

when I run

rabbitmqctl status

it gives me the following error:

{error_logger,{{2013,7,5},{14,47,10}},"Failed to create cookie file 'h:/.erlang.cookie': enoent",[]}

which again leads me to believe that there is an issue with the home argument. I need to be able to change this location to something local.

Versions:

Erlang R16B01 32 bit
RabbitMQ 3.1.3
Running on Win7

I have uninstalled and reinstalled multiple times hoping to resolve this. I am looking for a way to change the 'home' location in erlang so rabbitmq can properly start.

like image 613
Iron Ninja Avatar asked Jul 05 '13 19:07

Iron Ninja


People also ask

How do I place RabbitMQ server distribution in the Erlang lib folder?

Make Sure ERLANG_HOME is Set The RabbitMQ batch files expect to execute %ERLANG_HOME%\bin\erl.exe. Go to Start > Settings > Control Panel > System > Advanced > Environment Variables. Create the system environment variable ERLANG_HOME and set it to the full path of the directory which contains bin\erl.exe.

How do I change RabbitMQ data directory?

After install is complete – Open Elevated (Run as Administrator) Command prompt, navigate to the sbin directory. During install uncheck the RabbitMQ service. Start the RabbitMQ service. Run: rabbitmqctl status to check status.

What is the default port for RabbitMQ?

By default, RabbitMQ will listen on port 5672 on all available interfaces.


2 Answers

The solution I came up with was to not bother with the installed service. I used the rabbitmq-server.bat to start the service, SET HOMEDRIVE=C: at the start of the file. I'm planing to run this from a parent service so that I can install this on servers.

Final note to earlang and rabbitMQ developers; using pre-existing environment variables for you own purposes is just wrong. You should create your own, or better yet put this stuff in a configuration file. Telling people to talk to their system administrators to change the HOMEDRIVE and APPDATA variables is arrogant to say the least.

like image 60
Steve Avatar answered Sep 27 '22 19:09

Steve


You need to set the correct values ​​for variables $HOMEDRIVE and $HOMEPATH. These links should help:

  • Permanently Change Environment Variables in Windows
  • Overriding HOMEDRIVE and HOMEPATH as a Windows 7 user
like image 23
P_A Avatar answered Sep 27 '22 19:09

P_A