Git Product home page Git Product logo

Comments (14)

badlop avatar badlop commented on August 15, 2024

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.

skrleo avatar skrleo commented on August 15, 2024
~ $ 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.

badlop avatar badlop commented on August 15, 2024

I have another trouble now.

And did you solve the previous problem?

from docker-ejabberd.

skrleo avatar skrleo commented on August 15, 2024

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.

badlop avatar badlop commented on August 15, 2024

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:

  1. 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
  1. Start the container:
$ docker-compose up
  1. 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.

skrleo avatar skrleo commented on August 15, 2024

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.

badlop avatar badlop commented on August 15, 2024

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 simply ejabberdctl, no need to run bin/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.

skrleo avatar skrleo commented on August 15, 2024

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.

badlop avatar badlop commented on August 15, 2024

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.

skrleo avatar skrleo commented on August 15, 2024

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.

skrleo avatar skrleo commented on August 15, 2024

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.

badlop avatar badlop commented on August 15, 2024

from docker-ejabberd.

badlop avatar badlop commented on August 15, 2024

Hi @skrleo , I guess by now you already found a solution or a workaround, right?

from docker-ejabberd.

skrleo avatar skrleo commented on August 15, 2024

Yes thank you very much for your help and wish you a happy life @badlop

你好@skrleo,我想现在您已经找到了解决方案或解决方法,对吧?

from docker-ejabberd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.