ejabberd icon indicating copy to clipboard operation
ejabberd copied to clipboard

Add feature to change EPMD port?

Open rahmataw opened this issue 2 years ago • 4 comments

By default, when we use ejabberd it will run epmd on port 4369. Is it possible to add parameter to change epmd port?

rahmataw avatar Mar 03 '22 15:03 rahmataw

What's the usecase?

licaon-kter avatar Mar 03 '22 15:03 licaon-kter

What's the usecase?

I need to to create ejabberd cluster(2 node) on restricted environment and only allow port above 30000

rahmataw avatar Mar 03 '22 15:03 rahmataw

According to https://www.erlang.org/doc/man/epmd.html#environment_variables

I guess this should work:

diff --git a/ejabberdctl.cfg.example b/ejabberdctl.cfg.example
index 2300378e0..3c8117e18 100644
--- a/ejabberdctl.cfg.example
+++ b/ejabberdctl.cfg.example
@@ -3,6 +3,8 @@
 # to the erlang runtime system when starting ejabberd
 #
 
+ERL_EPMD_PORT=30000
+
 #' POLL: Kernel polling ([true|false])
 #
 # The kernel polling option requires support in the kernel.
diff --git a/ejabberdctl.template b/ejabberdctl.template
index 7f0e0c96d..53810ddeb 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -100,6 +100,7 @@ export EJABBERD_LOG_PATH
 export EJABBERD_PID_PATH
 export ERL_CRASH_DUMP
 export ERL_EPMD_ADDRESS
+export ERL_EPMD_PORT
 export ERL_INETRC
 export ERL_MAX_PORTS
 export ERL_MAX_ETS_TABLES

badlop avatar Mar 04 '22 11:03 badlop

Erlang 23.1 and newer allow a distribution method that doesn't require epmd at all.

This pull request adds support to ejabberd: https://github.com/processone/ejabberd/pull/3832

In that case, instead of opening a range of ports and 4369 (or whatever you configure in ERL_EPMD_PORT)... you only need to open 5210 (or whatever you configure in ERL_DIST_PORT).

badlop avatar Jun 01 '22 11:06 badlop

Now that ejabberd 22.10 includes support to use distribution without EPMD, I guess this issue and its related patch is irrelevant...

badlop avatar Nov 15 '22 12:11 badlop