Comments (4)
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.
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.
@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.
@vivobg OK, thanks
from emqx-docker.
Related Issues (20)
- failed to set log level HOT 2
- Fix ENV bridge configuration for emqx-edge docker
- New Alarm: cpu_high_watermark, Alarm Info: 100.0 HOT 10
- Dockerfile doesn't expose port 18084 for emqx dashboard SSL
- emqx crash
- Can't load emqx_bridge_mqtt plugin
- EMQX_MODULE__SUBSCRIPTION__3__TOPIC doesn't work
- How to persist data with docker run>? HOT 3
- The broker crashes when I run it by command for cluster HOT 1
- Authentication Issues using EMQX_ALLOW_ANONYMOUS=false HOT 1
- Load plugin emqx_auth_mysql error HOT 12
- Building image for arm64v8 HOT 3
- Unable to restart services in Swarm mode HOT 9
- An error occurred using the PGSQL plug-in for authentication in emqx docker
- emqx edge docker bridge connected lost after some time
- Link does not working HOT 2
- Naming rules and length limits for Bridges HOT 1
- ./bin/emqx_ctl users CLI not found and start error HOT 3
- Healthcheck makes emqx exit abnormally HOT 5
- customize plugin in doker image HOT 1
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 emqx-docker.