赞
踩
emqx官网下载地址 :https://www.emqx.io/zh
选择开源版本 就够用
这里有各种操作系统版本供选择
先来windows 配置
下载完成后安装进入bin目录
直接cmd
- .\emqx.cmd console //控制台启动
- .\emqx.cmd start //后台启动
- 启动完成 访问localhost:18083 默认控制台web端口
- 默认控制台账号密码 admin public
- 默认长连接 tcp://localhost:1883
这里因为只有一台电脑就直接搭建伪集群了
- windows集群搭建
-
-
- //node称之为节点 name节点名称 每个节点唯一 cookie 当搭建集群时 cookie 是节点通信的关键
- node {
- name = "emqx2@127.0.0.1"
- cookie = "emqxsecretcookie"
- data_dir = "data"
- }
- //集群配置 name集群名称 集群下所有的节点都是这个名称 static静态配置集权节点 seeds 节点信息
- cluster {
- name = emqxcl
- discovery_strategy = static
- static {
- seeds = ["emqx@127.0.0.1","emqx2@127.0.0.1"]
- }
- }
- //默认监听端口tcp max_connections 最大连接数
- listeners.tcp.default{
- bind = "0.0.0.0:1885"
- max_connections = 1024000
- }
-
- listeners.ws.default{
- bind = "0.0.0.0:8085"
- }
- listeners.ssl.default{
- bind = "0.0.0.0:8885"
- }
- listeners.wss.default{
- bind = "0.0.0.0:8086"
- }
- //默认控制台端口
- dashboard {
- listeners.http {
- bind = 18084
- }
- }
- 这里修改端口是防止端口被占用

-
- node {
- name = "emqx@127.0.0.1"
- cookie = "emqxsecretcookie"
- data_dir = "data"
- }
-
- cluster {
- name = emqxcl
- discovery_strategy = static
- static {
- seeds = ["emqx@127.0.0.1","emqx2@127.0.0.1"]
- }
- }
- dashboard {
- listeners.http {
- bind = 18083
- }
- }
- 因为刚刚的实例已经把端口分开了这里直接使用默认端口了,这样集群就实现了

下期发布linux docker搭建emqx(单个以及集群)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。