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