目录
产品部署建议 Linux 服务器,不推荐 Windows 服务器。
笔者选择Docker运行安装EMQ X broker
docker-compose.yaml 安装
- version: '3'
-
- services:
- emqx1:
- image: emqx/emqx:5.0.4
- container_name: emqx1
- environment:
- - "EMQX_NODE_NAME=emqx@node1.emqx.io"
- - "EMQX_CLUSTER__DISCOVERY_STRATEGY=static"
- - "EMQX_CLUSTER__STATIC__SEEDS=[emqx@node1.emqx.io,emqx@node2.emqx.io]"
- healthcheck:
- test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
- interval: 5s
- timeout: 25s
- retries: 5
- volumes:
- - ./emqx1.conf:/opt/emqx/etc/emqx.conf
- restart: always
- ports:
- - 2883:1883
- - 28083:8083
- - 18083:18083
- networks:
- emqx-bridge:
- aliases:
- - node1.emqx.io
-
- emqx2:
- image: emqx/emqx:5.0.4
- environment:
- - "EMQX_NODE_NAME=emqx@node2.emqx.io"
- - "EMQX_CLUSTER__DISCOVERY_STRATEGY=static"
- - "EMQX_CLUSTER__STATIC__SEEDS=[emqx@node1.emqx.io,emqx@node2.emqx.io]"
- healthcheck:
- test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
- interval: 5s
- timeout: 25s
- retries: 5
- volumes:
- - ./emqx1.conf:/opt/emqx/etc/emqx.conf
- restart: always
- ports:
- - 2884:1883
- - 28084:8083
- - 38084:18083
- networks:
- emqx-bridge:
- aliases:
- - node2.emqx.io
-
- networks:
- emqx-bridge:
- driver: bridge
默认 账号:admin 密码:public