Search code examples
erlangejabberdmnesia

Erlang version 18.0 and ejabberd nodename conflict


I wanted to install latest ejabberd from https://github.com/processone/ejabberd. For this, Erlang/OTP 18 is required. That too, i have manually installed from https://github.com/erlang/otp. Then, i need to start ejabberd server with command ejabberdctl start. But there is some error in that. My mnesia node name is akash@akash-Latitude-3450 and ejabberd nodename is akash@localhost. Due to this, server is not getting started. How to resolve this conflict ?

Log ->

2016-01-07 18:38:20.410 [critical] <0.39.0>@ejabberd_app:db_init:125 Node name mismatch: I'm [ejabberd@localhost], the database is owned by ['ejabberd@akash-Latitude-3450']

2016-01-07 18:38:20.410 [critical] <0.39.0>@ejabberd_app:db_init:127 Either set ERLANG_NODE in ejabberdctl.cfg or change node name in Mnesia

2016-01-07 18:38:20.410 [error] <0.38.0> CRASH REPORT Process <0.38.0> with 0 neighbours exited with reason: node_name_mismatch in ejabberd_app:db_init/0 line 129 in application_master:init/4 line 134


Solution

  • You have two options:

    1. name your Erlang node with the name matching your Mnesia database when you start ejabberd. As suggested by error message, it can be changed in var ERLANG_NODE in ejabberdctl.cfg.
    2. Backup Mnesia database by starting the node under old name, do a fresh install and restore your data with node started with the new name.