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

emqx静态集群

emqx静态集群

emqx 安装:

ZIP 压缩包安装 (Linux、MaxOS、Windows)

    通过 emqx.io (opens new window)或 Github (opens new window)下载要安装的 EMQX 版本的 zip 包。或者下载 EMQX(开源版--免费)

    解压程序包

    $ unzip emqx-ubuntu18.04-v4.0.0.zip
    

    启动 EMQX Broker

    $ ./bin/emqx start
    emqx 4.0.0 is started successfully!
    
    $ ./bin/emqx_ctl status
    Node 'emqx@127.0.0.1' is started
    emqx v4.0.0 is running
    

    停止 EMQX Broker

    $ ./bin/emqx stop
    ok
    

    卸载 EMQX Broker

    直接删除 EMQX 目录即可

----------------------------------------------------------------------------------------------

修改 emqx/etc/emqx.conf 配置文件,另一台同理

## 修改节点名
node.name = emqx@192.168.0.101

## 修改集群策略为static,无需手动添加节点了
cluster.discovery = static

## 所有集群节点	
cluster.static.seeds = emqx@192.168.0.101, emqx@192.168.0.102

#如果启动下面这条,用mqtt.fx连接时会出现connection lost ,原因未知
# listener.tcp.external.proxy_protocol = on

如果是在同一台计算机上部署emqx,则需要保证各自的节点名不一样,比如

node.name = emqx1@127.0.0.1 和 node.name = emqx2@127.0.0.1

查看集群状态

./bin/emqx_ctl cluster status

root@ubuntu2:/home/saintway/emqx/bin# ./emqx_ctl cluster status
Cluster status: #{running_nodes => ['emqx@192.168.0.101','emqx@192.168.0.102'],
                  stopped_nodes => []}

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

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

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