您当前的位置:首页 > 网站建设 > 网站维护
| php | asp | css | H5 | javascript | Mysql | Dreamweaver | Delphi | 网站维护 | 帝国cms | React | 考试系统 | ajax | jQuery |

使用docker

51自学网 2023-07-14 22:04:10
  网站维护

1、docker-compose.yml 文件,内容如下:

version: '3'services:  emqx1:    image: emqx:5.0.26    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    networks:      emqx-bridge:        aliases:        - node1.emqx.io    ports:      - 1883:1883      - 8083:8083      - 8084:8084      - 8883:8883      - 18083:18083     # volumes:    #   - $PWD/emqx1_data:/opt/emqx/data  emqx2:    image: emqx:5.0.26    container_name: emqx2    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    networks:      emqx-bridge:        aliases:        - node2.emqx.io    # volumes:    #   - $PWD/emqx2_data:/opt/emqx/datanetworks:  emqx-bridge:    driver: bridge

2、通过命令行切换 docker-compose.yml 文件所在目录,然后输入以下命令启动 EMQX 集群:

docker-compose up -d

3、查看集群状态

$ docker exec -it emqx1 sh -c "emqx_ctl cluster status"Cluster status: #{running_nodes => ['emqx@node1.emqx.com','emqx@node2.emqx.com'],                  stopped_nodes => []}

官方参考资料:https://www.emqx.io/docs/zh/v5/deploy/install-docker.html


下载地址:
nginx
Docker容器内部无法访问外网原因以及解决办法
51自学网自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1