Giter VIP home page Giter VIP logo

Comments (4)

je-al avatar je-al commented on August 23, 2024 1

I have a somewhat working setup for all of these.

3.- preprocessing of the configuration files through python / regex to generate go-lang text template files which then I process at startup using gucci. Variable names get mapped by ENV files by translating them, dots get replaced by __, the whole thing gets uppercased and default values are set to whatever was originally on the config file.

4-5.- there's a "special" env var which should be set to the service name, then basically nslookup to get all the IPs (does require that the service's endpoint mode is set to dnsrr when on swarm), and a while trying to cluster join.

6.- very raw trap setup.

Also, just because it's cleaner, I'm including supervisord. A proper solution (i.e. a pod running in k8s) would consist of at least three containers

I'm tidying up the thing anyways, so I could fork the repo on github if you're interested.

edit^2: I went ahead and did it anyways, they're available as feature branches at https://github.com/je-al/emq-docker

from emqx-docker.

vowstar avatar vowstar commented on August 23, 2024

Hi, thanks for your efforts to make clustering.
I noticed that you use nslookup to get all the IPs, but I found a problem that nslookup depends on busybox under alpine, it only support UDP method to get IP list. So it only can get 14 IPs at most. When swarm mode scale node number above 14, the IP will change every time and incomplete. This is because alpine's busybox use resolv unit to do dns query, but resolv under uclibc only support UDP method that the buffer only NS_PACKETSZ=512bytes. every where NS_PACKETSZ is 512
I used to use UDP to discovery service(at my old docker image https://github.com/devicexx/docker-images/blob/master/library/emqttd/latest/default/start.sh) but it not stable when run opt/emqttd/bin/emqttd_ctl cluster join 'emqttd@'${REMOTE_IP} many times, without success when node above 3. Then I tried method such like you use, using DNS to do service discovery.

I think your script can be optimized, do not use busybox's nslook up under apline due to 14 IPs limit, you can try install bind-tools by apk add --no-cache bind-tools and use nslookup which bind-tools provides, that is no problem. The easiest way is using ubuntu and ubuntu have no IP limits in nslookup(It's depends on glibc).

I'm also learning and studing how to make emq-cluster stable, when I success I'll open source it.
Thank you again and very glad to talking with you, I looking forwards to discussion cluster problem again.

from emqx-docker.

vivobg avatar vivobg commented on August 23, 2024

@vowstar
Please have a look at the EMQ 2.3 beta. It adds cluster autodiscovery. You might also find my comment to a similar issue useful: #13 (comment)

from emqx-docker.

vowstar avatar vowstar commented on August 23, 2024

@vivobg OK, thanks

from emqx-docker.

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.