mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明

mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明

摘自:https://blog.csdn.net/weixin_43025071/article/details/82491560

  1 mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明
  2 
  3 2018年09月07日 09:42:30 jacklin_001 阅读数:412
  4 # =================================================================
  5 # General configuration
  6 # =================================================================
  7 
  8 # 客户端心跳的间隔时间
  9 #retry_interval 20
 10 
 11 # 系统状态的刷新时间
 12 #sys_interval 10
 13 
 14 # 系统资源的回收时间,0表示尽快处理
 15 #store_clean_interval 10
 16 
 17 # 服务进程的PID
 18 #pid_file /var/run/mosquitto.pid
 19 
 20 # 服务进程的系统用户
 21 #user mosquitto
 22 
 23 # 客户端心跳消息的最大并发数
 24 #max_inflight_messages 10
 25 
 26 # 客户端心跳消息缓存队列
 27 #max_queued_messages 100
 28 
 29 # 用于设置客户端长连接的过期时间,默认永不过期
 30 #persistent_client_expiration
 31 
 32 # =================================================================
 33 # Default listener
 34 # =================================================================
 35 
 36 # 服务绑定的IP地址
 37 #bind_address
 38 
 39 # 服务绑定的端口号
 40 #port 1883
 41 
 42 # 允许的最大连接数,-1表示没有限制
 43 #max_connections -1
 44 
 45 # cafile:CA证书文件
 46 # capath:CA证书目录
 47 # certfile:PEM证书文件
 48 # keyfile:PEM密钥文件
 49 #cafile
 50 #capath
 51 #certfile
 52 #keyfile
 53 
 54 # 必须提供证书以保证数据安全性
 55 #require_certificate false
 56 
 57 # 若require_certificate值为true,use_identity_as_username也必须为true
 58 #use_identity_as_username false
 59 
 60 # 启用PSK(Pre-shared-key)支持
 61 #psk_hint
 62 
 63 # SSL/TSL加密算法,可以使用“openssl ciphers”命令获取
 64 # as the output of that command.
 65 #ciphers
 66 
 67 # =================================================================
 68 # Persistence
 69 # =================================================================
 70 
 71 # 消息自动保存的间隔时间
 72 #autosave_interval 1800
 73 
 74 # 消息自动保存功能的开关
 75 #autosave_on_changes false
 76 
 77 # 持久化功能的开关
 78 persistence true
 79 
 80 # 持久化DB文件
 81 #persistence_file mosquitto.db
 82 
 83 # 持久化DB文件目录
 84 #persistence_location /var/lib/mosquitto/
 85 
 86 # =================================================================
 87 # Logging
 88 # =================================================================
 89 
 90 # 4种日志模式:stdout、stderr、syslog、topic
 91 # none 则表示不记日志,此配置可以提升些许性能
 92 log_dest none
 93 
 94 # 选择日志的级别(可设置多项)
 95 #log_type error
 96 #log_type warning
 97 #log_type notice
 98 #log_type information
 99 
100 # 是否记录客户端连接信息
101 #connection_messages true
102 
103 # 是否记录日志时间
104 #log_timestamp true
105 
106 # =================================================================
107 # Security
108 # =================================================================
109 
110 # 客户端ID的前缀限制,可用于保证安全性
111 #clientid_prefixes
112 
113 # 允许匿名用户
114 #allow_anonymous true
115 
116 # 用户/密码文件,默认格式:username:password
117 #password_file
118 
119 # PSK格式密码文件,默认格式:identity:key
120 #psk_file
121 
122 # pattern write sensor/%u/data
123 # ACL权限配置,常用语法如下:
124 # 用户限制:user <username>
125 # 话题限制:topic [read|write] <topic>
126 # 正则限制:pattern write sensor/%u/data
127 #acl_file
128 
129 # =================================================================
130 # Bridges
131 # =================================================================
132 
133 # 允许服务之间使用“桥接”模式(可用于分布式部署)
134 #connection <name>
135 #address <host>[:<port>]
136 #topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix]
137 
138 # 设置桥接的客户端ID
139 #clientid
140 
141 # 桥接断开时,是否清除远程服务器中的消息
142 #cleansession false
143 
144 # 是否发布桥接的状态信息
145 #notifications true
146 
147 # 设置桥接模式下,消息将会发布到的话题地址
148 # $SYS/broker/connection/<clientid>/state
149 #notification_topic
150 
151 # 设置桥接的keepalive数值
152 #keepalive_interval 60
153 
154 # 桥接模式,目前有三种:automatic、lazy、once
155 #start_type automatic
156 
157 # 桥接模式automatic的超时时间
158 #restart_timeout 30
159 
160 # 桥接模式lazy的超时时间
161 #idle_timeout 60
162 
163 # 桥接客户端的用户名
164 #username
165 
166 # 桥接客户端的密码
167 #password
168 
169 # bridge_cafile:桥接客户端的CA证书文件
170 # bridge_capath:桥接客户端的CA证书目录
171 # bridge_certfile:桥接客户端的PEM证书文件
172 # bridge_keyfile:桥接客户端的PEM密钥文件
173 #bridge_cafile
174 #bridge_capath
175 #bridge_certfile
176 #bridge_keyfile
177 
178 # 自己的配置可以放到以下目录中
179 include_dir /etc/mosquitto/conf.d
原文地址:https://www.cnblogs.com/LiuYanYGZ/p/10370902.html