5

I want to use Exrm with Erlang distributed on a single machine.

I need to create multiple releases that differ only with node name.

I know, I can configure node name in rel/vm.args, but it will be static. Can I somehow generate multiple releases with different node name?

tkowal
  • 9,129
  • 1
  • 27
  • 51
  • At the risk of making a dumb suggestion--why not just hack together a bash script to do what you want? Copy the rel/vm.args and modify the node name string in each copy. – Onorio Catenacci Oct 29 '15 at 12:01
  • Not a dumb question at all. I was just curious, if there is a more standard way to do it. – tkowal Oct 29 '15 at 12:10
  • 1
    @bitwalker would be the one to answer this. Maybe post a link to your question on the Elixir mailing list so he can see your question. – Onorio Catenacci Oct 29 '15 at 13:11
  • When starting the release, can't you still pass arguments through the command line? If you can, you can just pass them in `bin/erl -name ...` overriding the ones in vm.args? – José Valim Oct 31 '15 at 21:53

1 Answers1

4

I am researching the same issue. A possible approach:

The rel/vm.args supports OS environment variables parametrization. So you can do something like

## Name of the node
-name ${MY_NODE_NAME}

## Cookie for distributed erlang
-setcookie ${MY_COOKIE}

Then you would invoke in batch file:

export RELX_REPLACE_OS_VARS=true
export MY_NODE_NAME=foobar@my_host
export MY_COOKIE=foobar

Note RELX_REPLACE_OS_VARS -- it is important!

vadim
  • 41
  • 2