Skip to content

Commit

Permalink
Set a fixed ERLANG_NODE, document how to change it
Browse files Browse the repository at this point in the history
Mention in the next ejabberd release notes that the default ERLANG_NODE
changed, and existing mnesia databases require setting the old one manually
  • Loading branch information
badlop committed Aug 16, 2021
1 parent 8e9f665 commit 46bac0f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions ecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,31 @@ Example usage (see the full [docker-compose.yml](https://github.com/processone/d
status
```
## Clustering
When setting several Docker containers to form a
[cluster of ejabberd nodes](https://docs.ejabberd.im/admin/guide/clustering/),
each one must have a different
[Erlang Node Name](https://docs.ejabberd.im/admin/guide/security/#erlang-node-name)
and the same
[Erlang Cookie](https://docs.ejabberd.im/admin/guide/security/#erlang-cookie).
For this you can either:
- edit `conf/ejabberdctl.cfg` and set variables `ERLANG_NODE` and `ERLANG_COOKIE`
- set the environment variables `ERLANG_NODE_ARG` and `ERLANG_COOKIE`

Once you have the ejabberd nodes properly set and running,
you can tell the secondary nodes to join the master node using the
[join_cluster](https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#join-cluster)
API call.

Example using environment variables (see the full [docker-compose.yml](https://github.com/processone/docker-ejabberd/issues/64#issuecomment-887741332) example):
```yaml
environment:
- ERLANG_NODE_ARG=ejabberd@replica1
- ERLANG_COOKIE=dummycookie123
- CTL_ON_CREATE=join_cluster ejabberd@main
```

# Generating ejabberd release

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion ecs/bin/ejabberdctl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ERL_PROCESSES=250000
ERL_MAX_ETS_TABLES=1400
FIREWALL_WINDOW="4370-4379"
INET_DIST_INTERFACE=""
ERLANG_NODE=ejabberd@$(hostname -s)
ERLANG_NODE=ejabberd@localhost
EJABBERD_BYPASS_WARNINGS=true

# define default environment variables
Expand Down
2 changes: 1 addition & 1 deletion ecs/conf/ejabberdctl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
#
# Default: ejabberd@localhost
#
#ERLANG_NODE=ejabberd@$(hostname)
#ERLANG_NODE=ejabberd@$(hostname -s)

#.
#' ERLANG_COOKIE: Erlang cookie for inter-node communication
Expand Down

0 comments on commit 46bac0f

Please sign in to comment.