当前位置:网站首页>Mqtt second session -- emqx high availability cluster implementation
Mqtt second session -- emqx high availability cluster implementation
2022-06-29 08:55:00 【Procedural ape with hair!】
Main records of this paper mqtt-emqx High availability cluster setup
1. Cluster building
be based on liunx centos7,docker-comspoe,emqx:4.4.4.
1.1 docker-compose.yaml file
version: '3.7'
services:
emqx01:
image: emqx:4.4.4
container_name: emqx01
ports:
- "1883:1883" #tcp Connect
- "18083:18083" # Console
- "8083:8083" # Console tools websocket ws use
- "8084:8084" # Console tools websocket wss use
environment:
- TZ=Asia/Shanghai
- EMQX_NAME=node01
- EMQX_CLUSTER__DISCOVERY=static
# Cluster nodes ip Secure the container ip best
- [email protected],[email protected],[email protected]
networks:
my-net:
ipv4_address: 172.19.0.221
emqx02:
image: emqx:4.4.4
container_name: emqx02
ports:
- "1813:1883"
- "18013:18083"
- "8013:8083"
- "8014:8084"
environment:
- TZ=Asia/Shanghai
- EMQX_NAME=node02
- EMQX_CLUSTER__DISCOVERY=static
# Cluster nodes ip Secure the container ip best
- [email protected],[email protected],[email protected]
networks:
my-net:
ipv4_address: 172.19.0.222
emqx03:
image: emqx:4.4.4
container_name: emqx03
ports:
- "1893:1883"
- "18093:18083"
- "8093:8083"
- "8094:8084"
environment:
- TZ=Asia/Shanghai
- EMQX_NAME=node03
- EMQX_CLUSTER__DISCOVERY=static
# Cluster nodes ip Secure the container ip best
- [email protected],[email protected],[email protected]
networks:
my-net:
ipv4_address: 172.19.0.223
networks:
# New network Internal service name call
my-net:
external: true
Set fixed Intranet ip when , You can go through it first docker network inspect my-net Get the network segment of the specified network
1.2 Start the container
[[email protected] emqx-cluster]# docker-compose up -d
Recreating emqx01 ... done
Creating emqx02 ... done
Creating emqx03 ... done
[[email protected] emqx-cluster]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4d45a3c5db23 emqx:4.4.4 "/usr/bin/docker-ent…" 9 seconds ago Up 6 seconds 4369-4370/tcp, 5369/tcp, 6369-6370/tcp, 0.0.0.0:1883->1883/tcp, 8081/tcp, 8883/tcp, 0.0.0.0:8083-8084->8083-8084/tcp, 0.0.0.0:18083->18083/tcp, 11883/tcp emqx01
0b3f9987307b emqx:4.4.4 "/usr/bin/docker-ent…" 9 seconds ago Up 6 seconds 4369-4370/tcp, 5369/tcp, 6369-6370/tcp, 8081/tcp, 8883/tcp, 11883/tcp, 0.0.0.0:1813->1883/tcp, 0.0.0.0:8013->8083/tcp, 0.0.0.0:8014->8084/tcp, 0.0.0.0:18013->18083/tcp emqx02
3c522f7bb76c emqx:4.4.4 "/usr/bin/docker-ent…" 9 seconds ago Up 6 seconds 4369-4370/tcp, 5369/tcp, 6369-6370/tcp, 8081/tcp, 8883/tcp, 11883/tcp, 0.0.0.0:1893->1883/tcp, 0.0.0.0:8093->8083/tcp, 0.0.0.0:8094->8084/tcp, 0.0.0.0:18093->18083/tcp emqx03
1.3 Cluster console interface

2.springboot Integrate
Integration code in the last article
MQTT First words – Docker install emqx as well as Springboot Integrate emqx With , No post here .
mqtt client The connection is a single address connection , So the cluster can be composed of nginx forward , It is necessary to add heartbeat detection , The forwarding address is filled in the intranet IP, There is no need to open to the outside world .
That's all for this chapter .
Last one :MQTT First words – Docker install emqx as well as Springboot Integrate emqx
Next :MongoDB First words – Docker install MongoDB as well as Springboot Integrate MongoDB
Setting up one's body and learning first , Learning is based on reading
边栏推荐
- Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences
- Oracle-子查询
- 关于父母离婚后子女姓名变更有关问题的批复
- mongoDB 持久化
- How to recover data loss of USB flash disk memory card
- Does the SQL server run with administrator privileges? Or run it as a normal user?
- MT-yolov6训练及测试
- Batch processing of experimental contact angle data matlab analysis
- Is it really safe to open a stock account online? Find the answer
- MQTT第二话 -- emqx高可用集群实现
猜你喜欢

机器人代码生成器之Robcogen使用教程

搭建开源物联网平台教程

Dialogue | prospects and challenges of privacy computing in the digital age

Transformer details

华为设备配置小型网络WLAN基本业务

实战回忆录:从Webshell开始突破边界

MQTT第二话 -- emqx高可用集群实现

The @dynamicmemberlookup and callasfunction features in swift implement the object transparent proxy function

Heavyweight released "FISCO bcos application landing guide"

802.11--802.11n protocol phy
随机推荐
How to gain profits from the operation of the points mall
微信小程序开发,如何添加多个空格
The final of the sixth season of 2022 perfect children's model Hefei division came to a successful conclusion
Uber前安全主管面临欺诈指控 曾隐瞒数据泄露事件
在 RedisTemplate 中使用 scan
Dialogue | prospects and challenges of privacy computing in the digital age
互斥量互斥锁
MQTT第二话 -- emqx高可用集群实现
hostname -f与uname -n的返回值可能不同
P6772 [noi2020] gourmet (matrix fast power)
《乔布斯传》英文原著重点词汇笔记(七)【 chapter five】
(III) encoder self attention mask
工厂模式和策略模式的区别
分布式数字身份的几个“非技术”思考
Chengtong network disk imitation blue playing network disk source code with video tutorial
[redis] redis6 learning framework ideas and details
Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences
批量处理实验接触角数据-MATLAB分析
uniapp微信小程序报错 TypeError: Cannot read property ‘call‘ of undefined
Speech signal processing - Fundamentals (I): basic acoustic knowledge