v5.0.25.conf 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. node {
  2. name = "emqx@127.0.0.1"
  3. cookie = "emqxsecretcookie"
  4. data_dir = "data"
  5. }
  6. cluster {
  7. name = emqxcl
  8. discovery_strategy = manual
  9. }
  10. dashboard {
  11. listeners.http {
  12. bind = 18083
  13. }
  14. listeners.https {
  15. bind = 18084
  16. depth = 5
  17. }
  18. }
  19. authentication = [
  20. {
  21. backend = "built_in_database"
  22. mechanism = "password_based"
  23. password_hash_algorithm {name = "sha256", salt_position = "suffix"}
  24. user_id_type = "username"
  25. }
  26. ]
  27. authorization {
  28. cache {
  29. enable = true
  30. max_size = 32
  31. ttl = "1m"
  32. }
  33. deny_action = "ignore"
  34. no_match = "allow"
  35. sources = [
  36. {
  37. body {username = "${username}"}
  38. connect_timeout = "15s"
  39. enable_pipelining = 100
  40. headers {"content-type" = "application/json"}
  41. method = "post"
  42. pool_size = 8
  43. request_timeout = "30s"
  44. ssl {enable = false, verify = "verify_peer"}
  45. type = "http"
  46. url = "http://127.0.0.1:8080"
  47. },
  48. {
  49. enable = true
  50. path = "${EMQX_ETC_DIR}/acl.conf"
  51. type = "file"
  52. }
  53. ]
  54. }
  55. bridges {
  56. webhook {
  57. test {
  58. connect_timeout = "15s"
  59. enable_pipelining = 100
  60. headers {"content-type" = "application/json"}
  61. method = "post"
  62. pool_size = 8
  63. pool_type = "random"
  64. request_timeout = "15s"
  65. resource_opts {
  66. auto_restart_interval = "60s"
  67. health_check_interval = "15s"
  68. inflight_window = 100
  69. max_buffer_bytes = "1GB"
  70. query_mode = "async"
  71. request_timeout = "15s"
  72. worker_pool_size = 4
  73. }
  74. ssl {enable = false, verify = "verify_peer"}
  75. url = "http://127.0.0.1:8080/webhook"
  76. }
  77. }
  78. }
  79. delayed {enable = false, max_delayed_messages = 2000}
  80. exhook {
  81. servers = [
  82. {
  83. auto_reconnect = "60s"
  84. enable = false
  85. failed_action = "deny"
  86. name = "test"
  87. pool_size = 16
  88. request_timeout = "5s"
  89. ssl {enable = false, verify = "verify_peer"}
  90. url = "http://127.0.0.1:8080"
  91. }
  92. ]
  93. }
  94. gateway {
  95. "lwm2m" {
  96. auto_observe = true
  97. enable_stats = true
  98. idle_timeout = "30s"
  99. lifetime_max = "86400s"
  100. lifetime_min = "1s"
  101. listeners {
  102. udp {
  103. default {
  104. bind = "5783"
  105. max_conn_rate = 1000
  106. max_connections = 1024000
  107. }
  108. }
  109. }
  110. mountpoint = ""
  111. qmode_time_window = "22s"
  112. translators {
  113. command {qos = 0, topic = "dn/#"}
  114. notify {qos = 0, topic = "up/notify"}
  115. register {qos = 0, topic = "up/resp"}
  116. response {qos = 0, topic = "up/resp"}
  117. update {qos = 0, topic = "up/update"}
  118. }
  119. update_msg_publish_condition = "contains_object_list"
  120. xml_dir = "etc/lwm2m_xml/"
  121. }
  122. }
  123. limiter {max_conn_rate = "2000/s"}
  124. listeners {
  125. ssl {
  126. default {
  127. acceptors = 16
  128. access_rules = ["allow all"]
  129. bind = "0.0.0.0:8883"
  130. enable_authn = true
  131. enabled = true
  132. max_connections = 5000000
  133. mountpoint = ""
  134. proxy_protocol = false
  135. proxy_protocol_timeout = "3s"
  136. ssl_options {
  137. cacertfile = "${EMQX_ETC_DIR}/certs/cacert.pem"
  138. certfile = "${EMQX_ETC_DIR}/certs/cert.pem"
  139. ciphers = []
  140. client_renegotiation = true
  141. depth = 10
  142. enable_crl_check = false
  143. fail_if_no_peer_cert = false
  144. gc_after_handshake = false
  145. handshake_timeout = "15s"
  146. hibernate_after = "5s"
  147. honor_cipher_order = true
  148. keyfile = "${EMQX_ETC_DIR}/certs/key.pem"
  149. ocsp {
  150. enable_ocsp_stapling = false
  151. refresh_http_timeout = "15s"
  152. refresh_interval = "5m"
  153. }
  154. reuse_sessions = true
  155. secure_renegotiate = true
  156. verify = "verify_none"
  157. versions = ["tlsv1.3", "tlsv1.2"]
  158. }
  159. tcp_options {
  160. active_n = 100
  161. backlog = 1024
  162. buffer = "4KB"
  163. high_watermark = "1MB"
  164. nodelay = true
  165. reuseaddr = true
  166. send_timeout = "15s"
  167. send_timeout_close = true
  168. }
  169. zone = "default"
  170. }
  171. }
  172. tcp {
  173. default {
  174. acceptors = 16
  175. access_rules = ["allow all"]
  176. bind = "0.0.0.0:1883"
  177. enable_authn = true
  178. enabled = true
  179. max_connections = 5000000
  180. mountpoint = ""
  181. proxy_protocol = false
  182. proxy_protocol_timeout = "3s"
  183. tcp_options {
  184. active_n = 100
  185. backlog = 1024
  186. buffer = "4KB"
  187. high_watermark = "1MB"
  188. nodelay = true
  189. reuseaddr = true
  190. send_timeout = "15s"
  191. send_timeout_close = true
  192. }
  193. zone = "default"
  194. }
  195. }
  196. ws {
  197. default {
  198. acceptors = 32
  199. access_rules = ["allow all"]
  200. bind = "0.0.0.0:8083"
  201. enable_authn = true
  202. enabled = true
  203. max_connections = 5000000
  204. mountpoint = ""
  205. proxy_protocol = false
  206. proxy_protocol_timeout = "3s"
  207. tcp_options {
  208. active_n = 100
  209. backlog = 1024
  210. buffer = "40KB"
  211. high_watermark = "1MB"
  212. nodelay = true
  213. reuseaddr = true
  214. send_timeout = "15s"
  215. send_timeout_close = true
  216. }
  217. websocket {
  218. allow_origin_absence = true
  219. check_origin_enable = false
  220. check_origins = "http://localhost:18083, http://127.0.0.1:18083"
  221. compress = false
  222. deflate_opts {
  223. client_context_takeover = "takeover"
  224. client_max_window_bits = 15
  225. mem_level = 8
  226. server_context_takeover = "takeover"
  227. server_max_window_bits = 15
  228. strategy = "default"
  229. }
  230. fail_if_no_subprotocol = true
  231. idle_timeout = "7200s"
  232. max_frame_size = "infinity"
  233. mqtt_path = "/mqtt"
  234. mqtt_piggyback = "multiple"
  235. proxy_address_header = "x-forwarded-for"
  236. proxy_port_header = "x-forwarded-port"
  237. supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
  238. }
  239. zone = "default"
  240. }
  241. }
  242. wss {
  243. default {
  244. acceptors = 16
  245. access_rules = ["allow all"]
  246. bind = "0.0.0.0:8084"
  247. enable_authn = true
  248. enabled = true
  249. max_connections = 5000000
  250. mountpoint = ""
  251. proxy_protocol = false
  252. proxy_protocol_timeout = "3s"
  253. ssl_options {
  254. cacertfile = "${EMQX_ETC_DIR}/certs/cacert.pem"
  255. certfile = "${EMQX_ETC_DIR}/certs/cert.pem"
  256. ciphers = []
  257. client_renegotiation = true
  258. depth = 10
  259. fail_if_no_peer_cert = false
  260. handshake_timeout = "15s"
  261. hibernate_after = "5s"
  262. honor_cipher_order = true
  263. keyfile = "${EMQX_ETC_DIR}/certs/key.pem"
  264. reuse_sessions = true
  265. secure_renegotiate = true
  266. verify = "verify_none"
  267. versions = ["tlsv1.3", "tlsv1.2"]
  268. }
  269. tcp_options {
  270. active_n = 100
  271. backlog = 1024
  272. buffer = "4KB"
  273. high_watermark = "1MB"
  274. nodelay = true
  275. reuseaddr = true
  276. send_timeout = "15s"
  277. send_timeout_close = true
  278. }
  279. websocket {
  280. allow_origin_absence = true
  281. check_origin_enable = false
  282. check_origins = "http://localhost:18083, http://127.0.0.1:18083"
  283. compress = false
  284. deflate_opts {
  285. client_context_takeover = "takeover"
  286. client_max_window_bits = 15
  287. mem_level = 8
  288. server_context_takeover = "takeover"
  289. server_max_window_bits = 15
  290. strategy = "default"
  291. }
  292. fail_if_no_subprotocol = true
  293. idle_timeout = "7200s"
  294. max_frame_size = "infinity"
  295. mqtt_path = "/mqtt"
  296. mqtt_piggyback = "multiple"
  297. proxy_address_header = "x-forwarded-for"
  298. proxy_port_header = "x-forwarded-port"
  299. supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
  300. }
  301. zone = "default"
  302. }
  303. }
  304. }
  305. log {
  306. console_handler {
  307. burst_limit {
  308. enable = true
  309. max_count = 10000
  310. window_time = "1s"
  311. }
  312. chars_limit = 10000
  313. drop_mode_qlen = 3000
  314. enable = true
  315. flush_qlen = 8000
  316. formatter = "text"
  317. level = "info"
  318. max_depth = 100
  319. overload_kill {
  320. enable = true
  321. mem_size = "30MB"
  322. qlen = 20000
  323. restart_after = "5s"
  324. }
  325. single_line = true
  326. supervisor_reports = "error"
  327. sync_mode_qlen = 100
  328. time_offset = "system"
  329. }
  330. file_handlers {
  331. default {
  332. burst_limit {
  333. enable = true
  334. max_count = 10000
  335. window_time = "1s"
  336. }
  337. chars_limit = "unlimited"
  338. drop_mode_qlen = 3000
  339. enable = false
  340. file = "${EMQX_LOG_DIR}/emqx.log"
  341. flush_qlen = 8000
  342. formatter = "text"
  343. level = "warning"
  344. max_depth = 100
  345. max_size = "50MB"
  346. overload_kill {
  347. enable = true
  348. mem_size = "30MB"
  349. qlen = 20000
  350. restart_after = "5s"
  351. }
  352. rotation {count = 10, enable = true}
  353. single_line = true
  354. supervisor_reports = "error"
  355. sync_mode_qlen = 100
  356. time_offset = "system"
  357. }
  358. }
  359. }
  360. mqtt {
  361. await_rel_timeout = "300s"
  362. exclusive_subscription = true
  363. idle_timeout = "15s"
  364. ignore_loop_deliver = true
  365. keepalive_backoff = 1
  366. max_awaiting_rel = 100
  367. max_clientid_len = 65535
  368. max_inflight = 32
  369. max_mqueue_len = 1000
  370. max_packet_size = "10MB"
  371. max_qos_allowed = 2
  372. max_subscriptions = 15
  373. max_topic_alias = 65535
  374. max_topic_levels = 128
  375. mqueue_default_priority = "lowest"
  376. mqueue_priorities = "disabled"
  377. "mqueue_store_qos0" = true
  378. peer_cert_as_clientid = "cn"
  379. peer_cert_as_username = "cn"
  380. response_information = ""
  381. retain_available = true
  382. retry_interval = "30s"
  383. server_keepalive = 15
  384. session_expiry_interval = "2h"
  385. shared_subscription = true
  386. strict_mode = true
  387. upgrade_qos = true
  388. use_username_as_clientid = true
  389. wildcard_subscription = true
  390. }
  391. retainer {
  392. backend {
  393. index_specs = [
  394. [1, 2, 3],
  395. [1, 3],
  396. [2, 3],
  397. [3]
  398. ]
  399. max_retained_messages = 120
  400. storage_type = "ram"
  401. type = "built_in_database"
  402. }
  403. enable = true
  404. max_payload_size = "1MB"
  405. msg_clear_interval = "2000ms"
  406. msg_expiry_interval = "10000ms"
  407. stop_publish_clear_msg = false
  408. }
  409. rule_engine {
  410. ignore_sys_message = true
  411. jq_function_default_timeout = "10s"
  412. rules {
  413. "rule_t7cl" {
  414. actions = ["webhook:test"]
  415. description = ""
  416. metadata {created_at = 1684222459298}
  417. sql = "SELECT\n *\nFROM\n \"t/#\""
  418. }
  419. }
  420. }
  421. slow_subs {
  422. enable = true
  423. expire_interval = "3000s"
  424. stats_type = "internal"
  425. threshold = "5000ms"
  426. top_k_num = 1000
  427. }
  428. sys_topics {
  429. sys_event_messages {
  430. client_connected = true
  431. client_disconnected = true
  432. client_subscribed = true
  433. client_unsubscribed = true
  434. }
  435. sys_heartbeat_interval = "30s"
  436. sys_msg_interval = "1m"
  437. }