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.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 => []}



