简体   繁体   中英

Parametrizing node name in Elixir Exrm

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?

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM