栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

基于 HAProxy 搭建 EMQ X 集群

基于 HAProxy 搭建 EMQ X 集群

emqx集群部分配置参考:emqx静态集群_白泽的博客-CSDN博客

本文着重记录HAPorxy搭建。

安装:

sudo apt-get update
sudo apt-get install software-properties-common -y
sudo add-apt-repository -y ppa:vbernat/haproxy-2.2
sudo apt-get update
sudo apt-get install -y haproxy=2.2.*
    配置 /etc/haproxy/haproxy.cfg,末尾增加:
listen mqtt-ssl
  bind *:8883 ssl crt /etc/ssl/emqx/emq.pem no-sslv3
  #bind *:1883  #不使用ssl可用这个配置
  mode tcp
  maxconn 50000
  timeout client 600s
  default_backend emqx_cluster
        
backend emqx_cluster
  mode tcp
  balance source
  timeout server 50s
  timeout check 5000
  server emqx1 192.168.0.2:1883 check inter 10000 fall 2 rise 5 weight 1  #emqx1为自定义名称
  server emqx2 192.168.0.3:1883 check inter 10000 fall 2 rise 5 weight 1

 启动haproxy:

sudo service haproxy start

停止haproxy:

sudo service haproxy stop

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/746166.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号