Parametrizing node name in Elixir Exrm

只谈情不闲聊 提交于 2019-12-22 07:09:33

问题


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?


回答1:


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!



来源:https://stackoverflow.com/questions/33406725/parametrizing-node-name-in-elixir-exrm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!