24 lines
896 B
YAML
24 lines
896 B
YAML
version: '3'
|
|
services:
|
|
emqx:
|
|
image: emqx/emqx:5.8.4
|
|
container_name: emqx
|
|
hostname: 192.168.20.50
|
|
network_mode: host # host模式配置
|
|
environment:
|
|
- EMQX_NODE__NAME=emqx@192.168.20.50 # 节点名称
|
|
- EMQX_NODE__COOKIE=emqx_dist_cookie
|
|
- EMQX_DASHBOARD__DEFAULT_PASSWORD=admin123456 # dashboard密码
|
|
- EMQX_CLUSTER__DISCOVERY_STRATEGY=static # 集群发现策略 可选 manual | static | dns | etcd | k8s | singleton
|
|
- EMQX_CLUSTER__STATIC__SEEDS=emqx@192.168.20.220,emqx@192.168.20.50,emqx@192.168.22.85 # 所有的节点都需要配置
|
|
- EMQX_API_KEY__BOOTSTRAP_FILE=/opt/emqx/etc/api_key.conf
|
|
ports: # host模式映射参数不生效
|
|
- "1883:1883"
|
|
- "8083:8083"
|
|
- "8084:8084"
|
|
- "8883:8883"
|
|
- "18083:18083"
|
|
volumes:
|
|
- ./api_key.conf:/opt/emqx/etc/api_key.conf
|
|
|