关于MOSQUETTO配置文件mosquetto.conf的配置
2020-02-17 05:05
393 查看
原文链接:https://www.cnblogs.com/saryli/p/9812452.html
# Config file for mosquitto # # See mosquitto.conf(5) for more information. # # Default values are shown, uncomment to change. # # Use the # character to indicate a comment, but only if it is the # very first character on the line. # ================================================================= # General configuration # ================================================================= # 客户端心跳的时间间隔,重新发送已经发出去的Qos 为1或者2的消息的等待时间 retry_interval 20 # 系统状态的刷新时间,设置为0表示不刷新 sys_interval 10 #系统资源的回收时间<br>#清除在内部消息存储里面的未引用的消息的时间。 #较低的值将占用较少的内存,但处理器时间较长, #越高的值将产生相反的效果。 #设置值为0意味着未引用的消息将以尽可能快的速度处理。 store_clean_interval 10 <br>#服务进程的PID #pid_file /var/run/mosquitto.pid # 以什么用户启动 mosquitto,此配置在 windows 下无效,以非 root 运行无效 #user mosquitto #客户端心跳消息的最大并非数<br>#当前每个客户端正在传输的Qo1和2消息的最大数量。 #这包括通过握手信息,以及那些正在重试的信息。 #默认为20。设置为0表示无上限。 #设置为1将保证QoS 1 和2的消息按顺序传递 max_inflight_messages 20 #客户端心跳消息缓存队列<br>#当前正在进行的队列中Qos 1和2条消息的最大数量。默认为100。 #设置到0表示没有上限(不推荐)。同样可参见queue_qos0_messages max_queued_messages 100 #设置为true,当一个持久客户端被断开连接时,以Qos为0将消息放到队列中。 #这些消息受max_queued_messages限制 queue_qos0_messages false #此选项设置被代理允许发布的消息的大小。 #超过这个尺寸的消息将不会被代理接受。 #默认值为0,这意味着所有有效的MQTT消息都被接受。 #MQTT的最大有效大小为268435455字节 message_size_limit 0 # 用于设置客户端长连接的过期时间,默认永不过期,必须以h d w m y为单位 #分别代表 小时,天,星期,月,念 #persistent_client_expiration # 如果客户端订阅了多个重叠的订阅,例如foo/#和foo/+/baz,然后MQTT期望当代理接 #收到一个与两个订阅相匹配的主题的消息时,例如foo/bar/baz,那么客户端应该只接 #收一次消息。为了满足这一要求,mosquitto不断跟踪发送给客户的消息。允许重复的 #消息选项允许禁用此行为,如果您有大量的客户端订阅相同的主题集合,并且非常关注 #最小化内存使用的情况,那么这个选项可能是有用的。如果你事先知道你的客户端永不 #会有重叠的订阅,那么你的客户必须能够正确处理重复的信息,即使在Qo = 2的时候, #你的客户端也必须能够正确地处理重复的信息 #allow_duplicate_messages false # ================================================================= # Default listener # ================================================================= # 服务绑定的IP地址 #bind_address # 服务绑定的端口号 #port 1883 # 允许的最大连接数,-1表示没有限制 #max_connections -1<br> # cafile:CA证书文件 # capath:CA证书目录 # certfile:PEM证书文件 # keyfile:PEM密钥文件 #cafile #capath #certfile #keyfile<br> # 必须提供证书以保证数据安全性 #require_certificate false<br> # 若require_certificate值为true,use_identity_as_username也必须为true #use_identity_as_username false<br> # 启用PSK(Pre-shared-key)支持 #psk_hint<br> # SSL/TSL加密算法,可以使用“openssl ciphers”命令获取 # as the output of that command. #ciphers<br> # ================================================================= # Persistence # =================================================================<br> # 消息自动保存的间隔时间 #autosave_interval 1800<br> # 消息自动保存功能的开关 #autosave_on_changes false<br> # 持久化功能的开关 persistence true<br> # 持久化DB文件 #persistence_file mosquitto.db<br> # 持久化DB文件目录 #persistence_location /var/lib/mosquitto/<br> # ================================================================= # Logging # =================================================================<br> # 4种日志模式:stdout、stderr、syslog、topic # none 则表示不记日志,此配置可以提升些许性能 log_dest none<br> # 选择日志的级别(可设置多项) #log_type error #log_type warning #log_type notice #log_type information<br> # 是否记录客户端连接信息 #connection_messages true<br> # 是否记录日志时间 #log_timestamp true<br> # ================================================================= # Security # =================================================================<br> # 客户端ID的前缀限制,可用于保证安全性 #clientid_prefixes<br> # 允许匿名用户 #allow_anonymous true<br> # 用户/密码文件,默认格式:username:password #password_file<br> # PSK格式密码文件,默认格式:identity:key #psk_file<br> # pattern write sensor/%u/data # ACL权限配置,常用语法如下: # 用户限制:user <username> # 话题限制:topic [read|write] <topic> # 正则限制:pattern write sensor/%u/data #acl_file<br> # ================================================================= # Bridges # =================================================================<br> # 允许服务之间使用“桥接”模式(可用于分布式部署) #connection <name> #address <host>[:<port>] #topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix]<br> # 设置桥接的客户端ID #clientid<br> # 桥接断开时,是否清除远程服务器中的消息 #cleansession false<br> # 是否发布桥接的状态信息 #notifications true<br> # 设置桥接模式下,消息将会发布到的话题地址 # $SYS/broker/connection/<clientid>/state #notification_topic<br> # 设置桥接的keepalive数值 #keepalive_interval 60<br> # 桥接模式,目前有三种:automatic、lazy、once #start_type automatic<br> # 桥接模式automatic的超时时间 #restart_timeout 30<br> # 桥接模式lazy的超时时间 #idle_timeout 60<br> # 桥接客户端的用户名 #username<br> # 桥接客户端的密码 #password # bridge_cafile:桥接客户端的CA证书文件 # bridge_capath:桥接客户端的CA证书目录 # bridge_certfile:桥接客户端的PEM证书文件 # bridge_keyfile:桥接客户端的PEM密钥文件 #bridge_cafile #bridge_capath #bridge_certfile #bridge_keyfile<br><br>
- 点赞
- 收藏
- 分享
- 文章举报
![](https://g.csdnimg.cn/static/user-reg-year/1x/1.png)
相关文章推荐
- Grails Quick Start
- iOS开发 粗解UIDynamicAnimator
- Fluent NHibernate的配置
- C# 浅谈ThreadPool -- 上篇(Enqueue)
- @RequestMa'pping注解 value的值
- element-ui 表格表头禁用全选功能
- XMLHttpRequest Level 2 使用指南
- XMLHttpRequests规范文档
- HBuilder的常用快捷键
- intelliJ idea自动生成UID
- 连接数据库提示: 'Client does not support authentication protocol requested by server
- JSON 用Iterator 遍历key 和value
- 【Uinty】物理基础
- elementUI table表头错位问题
- Document is missing mandatory uniqueKey field: id解决方案
- 灵活实用require.js,让JS加载速度更流畅
- UGUI 5.0 一些笔记
- uicollectionview 不调用cellForItemAtIndexPath
- UIViewController
- 学习基于LABVIEW的Arduino开发设计 ——8*8LED点阵转圈圈