Ejabberd + Docker | Node name mismatch: I'm [ejaberd@...], the database is owned by [ejabberd@...]

Viewed 848

I'm trying to setup ejabberd server via docker so I could use pidgin to chat with my teammates.

I have the following docker compose file:

version: "2"

services:
  ejabberd:
    image: rroemhild/ejabberd
    ports:
      - "5222:5222"
      - "5269:5269"
      - "5280:5280"
    environment:
      - ERLANG_NODE=ejabberd
      - XMPP_DOMAIN=localhost
      - EJABBERD_ADMINS=admin
      - EJABBERD_USERS=admin:pass1 user1:pass2 user2:pass3
    volumes:
      - ssl:/opt/ejabberd/ssl
      - backup:/opt/ejabberd/backup
      - upload:/opt/ejabberd/upload
      - database:/opt/ejabberd/database
volumes:
  ssl:
  backup:
  upload:
  database:

Whenever I try to launch ejabberd I get this error:

ejabberd_1 | 05:52:58.912 [critical] Node name mismatch: I'm [ejabberd@986834bd1bc8], the database is owned by [ejabberd@319f85780c99] ejabberd_1 | 05:52:58.912 [critical] Either set ERLANG_NODE in ejabberdctl.cfg or change node name in Mnesia

Is there something I'm missing?

1 Answers

Because your hostname is changing when Docker is initialised, you'll need to override the ERLANG_NODE setting in /etc/ejabberd/ejabberdctl.cfg. For example:

ERLANG_NODE=ejabberd@mypermanenthostname

If others are attempting to migrating an ejabberd instance, they can do something similar, but the instructions they really want are:

https://docs.ejabberd.im/admin/guide/managing/#ad-hoc-commands

Related