源码启动
quickmsg
# 下载源码
git clone https://github.com/quickmsg/smqttx
git close https://gitee.com/quickmsg/smqttx
# 打包
进入根目录 mvn clean package -Pjar,web
# 配置文件
smqtt:
logLevel: INFO # 系统日志
tcp: # tcp配置
port: 1883 # mqtt端口号
wiretap: false # 二进制日志 前提是 smqtt.logLevel = DEBUG
bossThreadSize: 8 # boss线程 默认=cpu核心数
workThreadSize: 16 # work线程 默认=cpu核心数*2
businessThreadSize: 32 # 业务线程数 默认=cpu核心数*10
businessQueueSize: 100000 #业务队列 默认=100000
messageMaxSize: 4194304 # 接收消息的最大限制 默认4194304(4M)
lowWaterMark: 4000000 # 不建议配置 默认 32768
highWaterMark: 80000000 # 不建议配置 默认 65536
# globalReadWriteSize: 10000000,100000000 全局读写大小限制
# channelReadWriteSize: 10000000,100000000 单个channel读写大小限制
options:
SO_BACKLOG: 2000
ssl: # ssl配置
enable: false # 开关
key: /user/server.key # 指定ssl文件 默认系统生成
crt: /user/server.crt # 指定ssl文件 默认系统生成
acl:
aclPolicy: NONE # NONE or FILE or JDBC
filePath: D:\smq-business\config\acl\basic_policy.csv # FILE时配置filePath
jdbcAclConfig:
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/smqtt
username: root
password: 123
auth:
fixed:
username: smqtt
password: smqtt
http: # http相关配置 端口固定60000
enable: true # 开关
accessLog: true # http访问日志
ssl: # ssl配置
enable: false
admin: # 后台管理配置
enable: true # 开关
username: smqtt # 访问用户名
password: smqtt # 访问密码
ws: # websocket配置
enable: true # 开关
port: 8999 # 端口
path: /mqtt # ws 的访问path mqtt.js请设置此选项
cluster: # 集群配置
enable: false # 集群开关
addresses: ["127.0.0.1"]
meter:
meterType: PROMETHEUS # INFLUXDB , PROMETHEUS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 启动
可执行jar包位于 /smqtt-bootstrap/target/
java -jar smqtt-bootstrap-2.0.2.jar config.yaml
启动成功后会在启动目录生成logs目录,查看smqtt-info.log日志会有如下输出:
15:09:35.145 [main] INFO io.github.quickmsg.jar.JarStarter - JarStarter start args config/config.yaml
21:33:19.754 [main] INFO i.g.q.common.utils.BannerUtils - ____ _ ____ _____ _____ ___ _
21:33:19.754 [main] INFO i.g.q.common.utils.BannerUtils - / ___\/ \__/|/ _ \/__ __\/__ __\\ \//
21:33:19.754 [main] INFO i.g.q.common.utils.BannerUtils - | \| |\/||| / \| / \ / \ \ /
21:33:19.754 [main] INFO i.g.q.common.utils.BannerUtils - \___ || | ||| \_\| | | | | / \
21:33:19.754 [main] INFO i.g.q.common.utils.BannerUtils - \____/\_/ \|\____\ \_/ \_/ /__/\\
15:10:03.532 [smqtt-cluster-io-select-nio-2] INFO i.g.quickmsg.core.DefaultTransport - server start success host 0:0:0:0:0:0:0:0 port 1883
15:10:03.537 [smqtt-cluster-io-select-nio-3] INFO i.g.quickmsg.core.DefaultTransport - server start success host 0:0:0:0:0:0:0:0 port 8999
15:10:03.711 [reactor-http-nio-1] INFO i.g.quickmsg.core.http.HttpTransport - server start success host 0:0:0:0:0:0:0:0 port 60000
15:10:04.113 [reactor-http-nio-1] INFO io.github.quickmsg.AbstractStarter -
-------------------------------------------------------------
Smqtt mqtt connect url 192.168.31.8:1883
Smqtt-Admin UI is running AccessURLs:
Http Local url: http://localhost:60000/smqtt/admin
Http External url: http://192.168.31.8:60000/smqtt/admin
-------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16