Comments (14)
I have two servers [192.168.10.1, 192.168.10.2]. I need to deploy clusters on the two servers.
Let's use the correct concepts: You have two servers, and you want to deploy two ejabberd nodes (one ejabberd node in each server), and setup them to become one cluster. Right?
Error: {no_ping,'[email protected]'}
Are both nodes running, and does "ejabberdctl status" work on each one of them?
Maybe the problem connecting is related to ports not yet opened.
ports:
- "5222:5222"
- "5269:5269"
- "5280:5280"
- "5443:5443"
5222 is for XMPP clients, 5269 for XMPP servers, 5280 and 5443 are for your admin, HTTP tasks... How can both nodes connect between them, if you didn't open the required ports for them to connect?
There is a full list of relevant ports in
https://docs.ejabberd.im/admin/guide/security/#firewall-settings
More specifically to this container, the list is
https://github.com/processone/docker-ejabberd/blob/master/ecs/README.md#ports
In your case, you probably need to open the ports range from 4369 to 4399.
Look at this example composer file:
https://github.com/processone/docker-ejabberd/blob/master/ecs/README.md#clustering-example
It starts two ejabberd nodes in the same machine, and they become a cluster.
Docker automatically takes care to setup both nodes in the same network, there are not port restrictions between both nodes, and consequently there is no need to explicitily open the ports 4369-4399. In your case, you have separate machines, so obviously you should tell each of the dockers to open the corresponding ports.
I don't have experience in docker-compose: is it possible to open a range of ports? Or it is only possible to open ports one by one?
from docker-ejabberd.
~ $ bin/ejabberdctl status
Failed RPC connection to the node ejabberd@cluster1: nodedown
Commands to start an ejabberd node:
start Start an ejabberd node in server mode
debug Attach an interactive Erlang shell to a running ejabberd node
iexdebug Attach an interactive Elixir shell to a running ejabberd node
live Start an ejabberd node in live (interactive) mode
iexlive Start an ejabberd node in live (interactive) mode, within an Elixir shell
foreground Start an ejabberd node in server mode (attached)
Optional parameters when starting an ejabberd node:
--config-dir dir Config ejabberd: /home/ejabberd/conf
--config file Config ejabberd: /home/ejabberd/conf/ejabberd.yml
--ctl-config file Config ejabberdctl: /home/ejabberd/conf/ejabberdctl.cfg
--logs dir Directory for logs: /home/ejabberd/logs
--spool dir Database spool dir: /home/ejabberd/database/ejabberd@cluster1
--node nodename ejabberd node name: ejabberd@cluster1
~ $ bin/ejabberdctl --node ejabberd@cluster1 start
ERROR: The ejabberd node 'ejabberd@cluster1' is already running.
I have another trouble now. I set the name of the container node, and I went into the container to query the node status and told me that the node is nodedown. When I specify a node, it prompts me that the node is already running in the execution state. Please tell me. what should be done
from docker-ejabberd.
I have another trouble now.
And did you solve the previous problem?
from docker-ejabberd.
And did you solve the previous problem?
Not yet, but there are some clues. need to set up hosts, but I need to solve this problem before you can deal with the following problems. clues case
from docker-ejabberd.
Ok, I have that same problem when using your first example docker-compose.yml
, because the variable [email protected]
does not match the hostname of the container where it is running.
One solution is to put in that variable the IP that the container will get.
Another solution that works for me too is to set as container_name the hostname that I will use in the ejabberd node name. Try it:
- Write in the file
docker-compose.yml
this:
version: '3.7'
services:
ejabberd:
image: ejabberd/ecs
container_name: cluster1
ports:
- "5222:5222"
- "5269:5269"
- "5280:5280"
- "5443:5443"
environment:
- ERLANG_NODE_ARG=ejabberd@cluster1
- ERLANG_COOKIE=dummycookie123
restart: always
- Start the container:
$ docker-compose up
- And in another window check that ejabberdctl works correctly:
$ docker exec -it cluster1 bin/ejabberdctl status
The node ejabberd@cluster1 is started with status: started
ejabberd 23.4.0 is running in that node
$ docker exec -it cluster1 bin/ejabberdctl register someaccount localhost somepass
User someaccount@localhost successfully registered
from docker-ejabberd.
First of all, thank you very much for your reply to me. I have a very serious problem now and need your help. Setting INET_DIST_INTERFACE parameter in ejabberdctl.cfg makes ejabberd crash
Edit the file ejabberd-23.04/bin/ejabberdctl. In line 80 it says:
INET_DIST_INTERFACE2=$("$ERL" -noshell ...
Add $ERLANG_OPTS. That variable includes arguments to tell erlang where to find the bootfile. For example:
INET_DIST_INTERFACE2=$("$ERL" $ERLANG_OPTS -noshell ...
I followed this method, but the error still occurred
~ $ bin/ejabberdctl reload_config
init terminating in do_boot (cannot expand $RELEASE_LIB in bootfile)
Crash dump is being written to: erl_crash.dump...done
{"could not start kernel pid",application_controller,"{bad_environment_value,\"{\\"init\"}"}
=ERROR REPORT==== 15-Sep-2023::01:03:31.349530 ===
application_controller: unterminated string starting with "init": {"init
could not start kernel pid (application_controller) ({bad_environment_value,"{\"init"})
Crash dump is being written to: /home/ejabberd/logs/erl_crash_20230915-010329.dump...done
What I want to add is that I use this solution to build the container.
Thank you again for your generous answer.
from docker-ejabberd.
Aha. The problem in ejabberdctl that you try to fix manually, was already solved in git. If you use the ejabberd
container image instead of the docker/ejabberd/ecs
image, you can use the most recent code, and you don't need to fix ejabberdctl yourself.
For example, to use the most recent ejabberd:master image:
version: '3.7'
services:
ejabberd:
image: ghcr.io/processone/ejabberd:master
container_name: cluster1
ports:
- "5222:5222"
- "5269:5269"
- "5280:5280"
- "5443:5443"
environment:
- ERLANG_NODE_ARG=ejabberd@cluster1
- ERLANG_COOKIE=dummycookie123
restart: always
This container image has a few differences, usually they are improvements. In your case, please notice that to use it, oyu may need to change a few path in your configuration files:
- it stores data in
/opt/ejabberd/
instead of/home/ejabberd/
ejabberdctl
is available running simplyejabberdctl
, no need to runbin/ejabberdctl
For example, with that container, ejabberdctl is used like this:
$ docker exec -it cluster1 ejabberdctl status
The node ejabberd@cluster1 is started with status: started
ejabberd 23.4.102 is running in that node
from docker-ejabberd.
ghcr.io/processone/ejabberd:master
May I ask which version of the code this container is? Because I have made some basic changes on the original basis, I can only build the container myself. My version is 23.04
from docker-ejabberd.
That container is built based in ejabberd git master for every commit. If you have a branch in your local git with your customizations, you can build the image yourself, as explained in CONTAINER.md Direct build
from docker-ejabberd.
That container is built based in ejabberd git master for every commit. If you have a branch in your local git with your customizations, you can build the image yourself, as explained in CONTAINER.md Direct build
Thank you very much for your reply, you solved a big problem for me.
from docker-ejabberd.
ghcr.io/processone/ejabberd:master
Setting INET_DIST_INTERFACE parameter in ejabberdctl.cfg makes ejabberd crash
~ $ ejabberdctl reload_config
Protocol 'inet_tcp': register/listen error: eaddrnotavail
from docker-ejabberd.
from docker-ejabberd.
Hi @skrleo , I guess by now you already found a solution or a workaround, right?
from docker-ejabberd.
Yes thank you very much for your help and wish you a happy life @badlop
你好@skrleo,我想现在您已经找到了解决方案或解决方法,对吧?
from docker-ejabberd.
Related Issues (20)
- Accessing the ejabberd server using GCP Kubernetes deployment HOT 2
- Ejabberd in GCP Kubernetes: Service not accessible in ingress. HOT 8
- How to format ejabberd nodes and establish s2s to form ejabberd cluster while deploying in GKE HOT 1
- Issues running debugger in DevContainers (CodeServer and VSCode) HOT 3
- After using the ecs Dockerfile to build the image and package it into the server, the following exception information appears HOT 5
- After build the docker image unable to run it. Getting ejabberdctl file not found error. HOT 2
- Ejabberd + Postgres in Docker-compose HOT 2
- ** (Mix) The task "distillery.init" could not be found HOT 4
- CTL_ON_CREATE register admin error stopping init in 23.10 HOT 3
- Missing ejabberd version number in ecs 24.02 image HOT 1
- Zombie process HOT 2
- cafile and ca-certificates HOT 1
- ecs: Alpine Linux 3.14 is not newest version HOT 1
- ejabberd arm64 docker image HOT 12
- ejabberd/ecs startup failing in machines where ipv6 is disabled HOT 3
- Cannot mount /conf to the host HOT 2
- Unable to restore from backup HOT 5
- Feature: Let ejabberd startup fail if either CTL_ON_CREATE or CTL_ON_START fail HOT 3
- No Captcha: ImageMagick is not installed inner the Image HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ejabberd.