0
votes

I am trying to change node name of mongooseim to my local ip, something like 10.0.0.21. I changed the config in MongooseIM/rel/vars.config.>

{node_name,"[email protected]"}

Is there anything i need to change?

I am getting the following error when i change the node name

=INFO REPORT==== 11-Mar-2016::17:11:05 === Can't set short node name! Please check your configuration escript: exception error: no match of right hand side value {error, {{shutdown, {failed_to_start_child,net_kernel, {'EXIT',nodistribution}}}, {child,undefined,net_sup_dynamic, {erl_distribution,start_link, [['[email protected]', shortnames]]}, permanent,1000,supervisor, [erl_distribution]}}}

1

1 Answers

1
votes

From what you write I assume that you're changing the node name at build time and relying on the build machinery to generate correct configuration file. This is OK.

In this light, you also have to modify rel/files/vm.args - find the line:

-sname {{node_name}}

and change it to:

-name {{node_name}}

Now the explanation. -name is used to run an Erlang node as a distributed node. This requires a DNS server to be set up. -sname also enables distributed mode, but is fine with just /etc/hosts entries - the node names, however, can't contain dots: host@localdomain is fine, but [email protected] is not. The latter is your case, with the small difference that you use numbers instead of words.

Please note that nodes using -name can't use Distributed Erlang communication with nodes using -sname.


For a production multi-node cluster you might consider generating the server release once, taking the generated config files, tweaking them to your needs and replicating as makes sense for the expected number of nodes. Then each time you deploy a new node you use the same generated release (which saves on build time), but add your configuration files customized for the relevant node.