Git Product home page Git Product logo

Comments (8)

rroemhild avatar rroemhild commented on May 9, 2024

The cluster example use random ports for mapping to the host machine. You can see the mapped ports with docker-compose ps.

from docker-ejabberd.

who avatar who commented on May 9, 2024

Yes, I see that the ports are randomized.

That said, how does one connect to the XMPP server after issuing the docker-compose scale command ?

from docker-ejabberd.

rroemhild avatar rroemhild commented on May 9, 2024

Sorry for the delay. In this example I just demonstrate how to extend the container image to setup an ejabberd cluster. For production, you could use i.e. haproxy to route the traffic to the container.

from docker-ejabberd.

rroemhild avatar rroemhild commented on May 9, 2024

I close this. Fell free to open this issue if you still have problems with the docker-compose cluster example. Maybe I'll extend the example some day with a working proxy setup.

from docker-ejabberd.

richardardrichard avatar richardardrichard commented on May 9, 2024

This is example was working for me at some point in the past, but now I'm having issues getting the different Ejabberd containers to actually talk to each other. While the cli output looks successful, the ejabberdctl ping call from the second node never actually returns anything other than pang.

Here is some slightly abridged output (sorry for how huge it is):

richard:tmp $ cd docker-ejabberd/examples/docker-compose-cluster
richard:docker-compose-cluster (master) $ docker-compose build
Building ejabberd...
Step 0 : FROM rroemhild/ejabberd
latest: Pulling from rroemhild/ejabberd
d0ca40da9e35: Pull complete
d1f66aef36c9: Pull complete
be84802a5a74: Pull complete
4af2a950fc18: Pull complete
95a998ea62aa: Pull complete
ccd41400e806: Pull complete
fcafb9ba97c5: Pull complete
c1da87600eeb: Pull complete
2c826a49b2c8: Pull complete
b370adf8e912: Pull complete
f11c775f0334: Pull complete
235b5b274160: Pull complete
d61dd9efd35b: Pull complete
977024487a73: Pull complete
c3cb959cbfba: Pull complete
56b75fbedf60: Pull complete
370f05e723ea: Pull complete
8ed36b2f9585: Pull complete
828d7b215d4f: Pull complete
c315884916ef: Pull complete
3bc03ecb2403: Pull complete
2ac898c9ba98: Pull complete
786d468fd6c4: Pull complete
69bd63456104: Pull complete
46c47441bacd: Pull complete
218ca035dfc0: Pull complete
2a5c108804d4: Pull complete
Digest: sha256:e24630e3b1172af883a3b1c3bbb66d51a3e23e56fc6b7173abb83006366dcb05
Status: Downloaded newer image for rroemhild/ejabberd:latest
 ---> 2a5c108804d4
Step 1 : ENV EJABBERD_HOME /opt/ejabberd
 ---> Running in c2290da360f0
 ---> 007e04d77982
Removing intermediate container c2290da360f0
Step 2 : COPY ./scripts $EJABBERD_HOME/scripts
 ---> d68bb18f430d
Removing intermediate container 75335981abc2
Successfully built d68bb18f430d
dnsdock uses an image, skipping
richard:docker-compose-cluster (master) $ docker-compose up -d
Creating dockercomposecluster_ejabberd_1...
Pulling dnsdock (tonistiigi/dnsdock:latest)...
latest: Pulling from tonistiigi/dnsdock
d634beec75db: Pull complete
211834dfe741: Pull complete
c4fd424533e7: Pull complete
2b61ab86ef3c: Pull complete
c89948b7275c: Pull complete
104a60e309c6: Pull complete
c3c7838f71ee: Pull complete
675abc80cc27: Pull complete
de10fb84941a: Pull complete
17d76ec6ed4b: Pull complete
8bca6325d479: Pull complete
1632e31f0f0e: Pull complete
728668309a8b: Pull complete
231630096ace: Pull complete
ce4b4745f642: Pull complete
5d717d129476: Pull complete
d67d93827bcf: Pull complete
1130c820c470: Pull complete
Digest: sha256:a8e6a50f0e6a58f2e5b9cfd0f63a9f27e28e3e93cbad4682aad2343fdb167cbb
Status: Downloaded newer image for tonistiigi/dnsdock:latest
Creating dockercomposecluster_dnsdock_1...
richard:docker-compose-cluster (master) $ docker logs -f dockercomposecluster_ejabberd_1
Error: error sending query: Could not send or receive, because of network error
Missing ssl cert for your host. Generating snakeoil ssl cert for a305bb4d5a79.dockercomposecluster_ejabberd.docker...
Generating a 2048 bit RSA private key
.......................................+++
..............................................................................................................................................+++
writing new private key to '/tmp/selfsigned.key'
-----
Writing ssl cert and private key to '/opt/ejabberd/ssl/host.pem'...
Missing ssl cert for your xmpp domain. Generating snakeoil ssl cert for example.com...
Generating a 2048 bit RSA private key
.........................................................+++
.......................+++
writing new private key to '/tmp/selfsigned.key'
-----
Writing ssl cert and private key to '/opt/ejabberd/ssl/example.com.pem'...
Set erlang cookie to testCluster...
Generating ejabberd config file...
Generating ejabberdctl config file...
Error: error sending query: Could not send or receive, because of network error
Error: error sending query: Could not send or receive, because of network error
Starting ejabberd...
tail: cannot open ‘/var/log/ejabberd/crash.log’ for reading: No such file or directory
tail: cannot open ‘/var/log/ejabberd/error.log’ for reading: No such file or directory
tail: cannot open ‘/var/log/ejabberd/erlang.log’ for reading: No such file or directory
tail: ‘/var/log/ejabberd/crash.log’ has been replaced with a remote file. giving up on this name
tail: ‘/var/log/ejabberd/error.log’ has been replaced with a remote file. giving up on this name
19:30:41.895 [info] Application lager started on node '[email protected]_ejabberd.docker'
19:30:41.901 [info] Application crypto started on node '[email protected]_ejabberd.docker'
19:30:41.908 [info] Application sasl started on node '[email protected]_ejabberd.docker'
19:30:41.912 [info] Application asn1 started on node '[email protected]_ejabberd.docker'
19:30:41.912 [info] Application public_key started on node '[email protected]_ejabberd.docker'
19:30:41.918 [info] Application ssl started on node '[email protected]_ejabberd.docker'
19:30:41.922 [info] Application p1_yaml started on node '[email protected]_ejabberd.docker'
19:30:41.926 [info] Application p1_tls started on node '[email protected]_ejabberd.docker'
19:30:41.930 [info] Application p1_xml started on node '[email protected]_ejabberd.docker'
19:30:41.932 [info] Application p1_stringprep started on node '[email protected]_ejabberd.docker'
19:30:41.934 [info] Application p1_zlib started on node '[email protected]_ejabberd.docker'
19:30:41.936 [info] Application p1_cache_tab started on node '[email protected]_ejabberd.docker'
19:30:42.006 [info] Application mnesia started on node '[email protected]_ejabberd.docker'
19:30:42.332 [info] Application inets started on node '[email protected]_ejabberd.docker'
19:30:42.530 [info] FQDN used to check DIGEST-MD5 SASL authentication: a305bb4d5a79.dockercomposecluster_ejabberd.docker
19:30:42.536 [info] Application oauth2 started on node '[email protected]_ejabberd.docker'
19:30:42.551 [info] Application p1_iconv started on node '[email protected]_ejabberd.docker'
19:30:42.614 [info] Reusing listening port for 4560
19:30:42.614 [info] Reusing listening port for 5222
19:30:42.614 [info] Reusing listening port for 5269
19:30:42.614 [info] Reusing listening port for 5280
19:30:42.614 [info] ejabberd 15.09 is started in the node '[email protected]_ejabberd.docker'
19:30:42.615 [info] Application ejabberd started on node '[email protected]_ejabberd.docker'
User [email protected] successfully registered
Password for user [email protected] is test321
User [email protected] successfully registered
Password for user [email protected] is T9Psh9-capV1Cqtx
richard:docker-compose-cluster (master) $ docker-compose scale ejabberd=2
Creating and starting 2... done
richard:docker-compose-cluster (master) $ docker logs dockercomposecluster_ejabberd_2
Missing ssl cert for your host. Generating snakeoil ssl cert for dockercomposecluster_ejabberd_2...
Generating a 2048 bit RSA private key
............+++
.................................................................+++
writing new private key to '/tmp/selfsigned.key'
-----
Writing ssl cert and private key to '/opt/ejabberd/ssl/host.pem'...
Missing ssl cert for your xmpp domain. Generating snakeoil ssl cert for example.com...
Generating a 2048 bit RSA private key
..+++
............................................+++
writing new private key to '/tmp/selfsigned.key'
-----
Writing ssl cert and private key to '/opt/ejabberd/ssl/example.com.pem'...
Set erlang cookie to testCluster...
Generating ejabberd config file...
Generating ejabberdctl config file...
Join cluster...
Waiting for ejabberd@dockercomposecluster_ejabberd_1...
Waiting for ejabberd@dockercomposecluster_ejabberd_1...
Waiting for ejabberd@dockercomposecluster_ejabberd_1...

from docker-ejabberd.

rroemhild avatar rroemhild commented on May 9, 2024

It looks like that this can be related to at least the following two commits:

from docker-ejabberd.

richardardrichard avatar richardardrichard commented on May 9, 2024

FWIW it seems to be something messed up with ejabebrdctl ping, as just running the command to join the cluster seems to be working fine. I opened an issue with Ejabberd here for anyone else having this problem processone/ejabberd#797

from docker-ejabberd.

richardardrichard avatar richardardrichard commented on May 9, 2024

Just for future people reading this issue, this was also a problem for me: processone/ejabberd#805

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.