e5.0.3.conf 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  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. }
  15. authentication = [
  16. {
  17. backend = "built_in_database"
  18. mechanism = "password_based"
  19. password_hash_algorithm {name = "sha256", salt_position = "suffix"}
  20. user_id_type = "username"
  21. }
  22. ]
  23. authorization {
  24. cache {
  25. enable = true
  26. max_size = 32
  27. ttl = "1m"
  28. }
  29. deny_action = "ignore"
  30. no_match = "allow"
  31. sources = [
  32. {
  33. body {username = "${username}"}
  34. connect_timeout = "15s"
  35. enable_pipelining = 100
  36. headers {"content-type" = "application/json"}
  37. method = "post"
  38. pool_size = 8
  39. request_timeout = "30s"
  40. ssl {enable = false, verify = "verify_peer"}
  41. type = "http"
  42. url = "http://127.0.0.1:8080"
  43. },
  44. {
  45. enable = true
  46. path = "${EMQX_ETC_DIR}/acl.conf"
  47. type = "file"
  48. }
  49. ]
  50. }
  51. delayed {enable = true, max_delayed_messages = 200}
  52. exhook {
  53. servers = [
  54. {
  55. auto_reconnect = "60s"
  56. enable = false
  57. failed_action = "deny"
  58. name = "test"
  59. pool_size = 16
  60. request_timeout = "5s"
  61. ssl {enable = false, verify = "verify_peer"}
  62. url = "http://127.0.0.1:8080"
  63. }
  64. ]
  65. }
  66. gateway {
  67. coap {
  68. connection_required = false
  69. enable_stats = true
  70. listeners {
  71. udp {
  72. default {
  73. bind = "5683"
  74. max_conn_rate = 1000
  75. max_connections = 1024000
  76. }
  77. }
  78. }
  79. mountpoint = ""
  80. notify_type = "qos"
  81. publish_qos = "coap"
  82. subscribe_qos = "coap"
  83. }
  84. }
  85. limiter {
  86. bytes_in {burst = "10MB", rate = "10MB/s"}
  87. client {
  88. bytes_in {
  89. capacity = "infinity"
  90. divisible = false
  91. failure_strategy = "force"
  92. initial = "10KB"
  93. low_watermark = "0"
  94. max_retry_time = "10s"
  95. rate = "100KB/s"
  96. }
  97. connection {
  98. capacity = "infinity"
  99. divisible = false
  100. failure_strategy = "force"
  101. initial = "100"
  102. low_watermark = "0"
  103. max_retry_time = "10s"
  104. rate = "100"
  105. }
  106. internal {
  107. capacity = "infinity"
  108. divisible = false
  109. failure_strategy = "force"
  110. initial = "100"
  111. low_watermark = "0"
  112. max_retry_time = "10s"
  113. rate = "100"
  114. }
  115. message_in {
  116. capacity = "infinity"
  117. divisible = false
  118. failure_strategy = "force"
  119. initial = "100"
  120. low_watermark = "0"
  121. max_retry_time = "10s"
  122. rate = "100"
  123. }
  124. message_routing {
  125. capacity = "infinity"
  126. divisible = false
  127. failure_strategy = "force"
  128. initial = "100"
  129. low_watermark = "0"
  130. max_retry_time = "10s"
  131. rate = "100"
  132. }
  133. }
  134. connection {burst = "1000", rate = "1000"}
  135. internal {burst = "1000", rate = "1000"}
  136. message_in {burst = "1000", rate = "1000"}
  137. message_routing {burst = "1000", rate = "1000"}
  138. }
  139. listeners {
  140. ssl {
  141. default {
  142. acceptors = 16
  143. access_rules = ["allow all"]
  144. bind = "0.0.0.0:8883"
  145. enable_authn = true
  146. enabled = true
  147. limiter {
  148. bytes_in {
  149. capacity = "infinity"
  150. initial = "0"
  151. rate = "infinity"
  152. }
  153. client {
  154. bytes_in {
  155. capacity = "infinity"
  156. divisible = false
  157. failure_strategy = "force"
  158. initial = "0"
  159. low_watermark = "0"
  160. max_retry_time = "10s"
  161. rate = "infinity"
  162. }
  163. connection {
  164. capacity = "infinity"
  165. divisible = false
  166. failure_strategy = "force"
  167. initial = "0"
  168. low_watermark = "0"
  169. max_retry_time = "10s"
  170. rate = "infinity"
  171. }
  172. message_in {
  173. capacity = "infinity"
  174. divisible = false
  175. failure_strategy = "force"
  176. initial = "0"
  177. low_watermark = "0"
  178. max_retry_time = "10s"
  179. rate = "infinity"
  180. }
  181. message_routing {
  182. capacity = "infinity"
  183. divisible = false
  184. failure_strategy = "force"
  185. initial = "0"
  186. low_watermark = "0"
  187. max_retry_time = "10s"
  188. rate = "infinity"
  189. }
  190. }
  191. connection {
  192. capacity = "1000"
  193. initial = "0"
  194. rate = "1000/s"
  195. }
  196. message_in {
  197. capacity = "infinity"
  198. initial = "0"
  199. rate = "infinity"
  200. }
  201. message_routing {
  202. capacity = "infinity"
  203. initial = "0"
  204. rate = "infinity"
  205. }
  206. }
  207. max_connections = 5000000
  208. mountpoint = ""
  209. proxy_protocol = false
  210. proxy_protocol_timeout = "3s"
  211. ssl_options {
  212. cacertfile = "${EMQX_ETC_DIR}/certs/cacert.pem"
  213. certfile = "${EMQX_ETC_DIR}/certs/cert.pem"
  214. ciphers = []
  215. client_renegotiation = true
  216. depth = 10
  217. enable_crl_check = false
  218. fail_if_no_peer_cert = false
  219. gc_after_handshake = false
  220. handshake_timeout = "15s"
  221. hibernate_after = "5s"
  222. honor_cipher_order = true
  223. keyfile = "${EMQX_ETC_DIR}/certs/key.pem"
  224. ocsp {
  225. enable_ocsp_stapling = false
  226. refresh_http_timeout = "15s"
  227. refresh_interval = "5m"
  228. }
  229. reuse_sessions = true
  230. secure_renegotiate = true
  231. verify = "verify_none"
  232. versions = ["tlsv1.3", "tlsv1.2", "tlsv1.1", "tlsv1"]
  233. }
  234. tcp_options {
  235. active_n = 100
  236. backlog = 1024
  237. buffer = "4KB"
  238. high_watermark = "1MB"
  239. nodelay = true
  240. reuseaddr = true
  241. send_timeout = "15s"
  242. send_timeout_close = true
  243. }
  244. zone = "default"
  245. }
  246. }
  247. tcp {
  248. default {
  249. acceptors = 16
  250. access_rules = ["allow all"]
  251. bind = "0.0.0.0:1883"
  252. enable_authn = true
  253. enabled = true
  254. limiter {
  255. bytes_in {
  256. capacity = "infinity"
  257. initial = "0"
  258. rate = "infinity"
  259. }
  260. client {
  261. bytes_in {
  262. capacity = "infinity"
  263. divisible = false
  264. failure_strategy = "force"
  265. initial = "0"
  266. low_watermark = "0"
  267. max_retry_time = "10s"
  268. rate = "infinity"
  269. }
  270. connection {
  271. capacity = "infinity"
  272. divisible = false
  273. failure_strategy = "force"
  274. initial = "0"
  275. low_watermark = "0"
  276. max_retry_time = "10s"
  277. rate = "infinity"
  278. }
  279. message_in {
  280. capacity = "infinity"
  281. divisible = false
  282. failure_strategy = "force"
  283. initial = "0"
  284. low_watermark = "0"
  285. max_retry_time = "10s"
  286. rate = "infinity"
  287. }
  288. message_routing {
  289. capacity = "infinity"
  290. divisible = false
  291. failure_strategy = "force"
  292. initial = "0"
  293. low_watermark = "0"
  294. max_retry_time = "10s"
  295. rate = "infinity"
  296. }
  297. }
  298. connection {
  299. capacity = "1000"
  300. initial = "0"
  301. rate = "1000/s"
  302. }
  303. message_in {
  304. capacity = "infinity"
  305. initial = "0"
  306. rate = "infinity"
  307. }
  308. message_routing {
  309. capacity = "infinity"
  310. initial = "0"
  311. rate = "infinity"
  312. }
  313. }
  314. max_connections = 12222
  315. mountpoint = ""
  316. proxy_protocol = false
  317. proxy_protocol_timeout = "3s"
  318. tcp_options {
  319. active_n = 100
  320. backlog = 1024
  321. buffer = "4KB"
  322. high_watermark = "1MB"
  323. nodelay = true
  324. reuseaddr = true
  325. send_timeout = "15s"
  326. send_timeout_close = true
  327. }
  328. zone = "default"
  329. }
  330. }
  331. ws {
  332. default {
  333. acceptors = 16
  334. access_rules = ["allow all"]
  335. bind = "0.0.0.0:8083"
  336. enable_authn = true
  337. enabled = true
  338. limiter {
  339. bytes_in {
  340. capacity = "infinity"
  341. initial = "0"
  342. rate = "infinity"
  343. }
  344. client {
  345. bytes_in {
  346. capacity = "infinity"
  347. divisible = false
  348. failure_strategy = "force"
  349. initial = "0"
  350. low_watermark = "0"
  351. max_retry_time = "10s"
  352. rate = "infinity"
  353. }
  354. connection {
  355. capacity = "infinity"
  356. divisible = false
  357. failure_strategy = "force"
  358. initial = "0"
  359. low_watermark = "0"
  360. max_retry_time = "10s"
  361. rate = "infinity"
  362. }
  363. message_in {
  364. capacity = "infinity"
  365. divisible = false
  366. failure_strategy = "force"
  367. initial = "0"
  368. low_watermark = "0"
  369. max_retry_time = "10s"
  370. rate = "infinity"
  371. }
  372. message_routing {
  373. capacity = "infinity"
  374. divisible = false
  375. failure_strategy = "force"
  376. initial = "0"
  377. low_watermark = "0"
  378. max_retry_time = "10s"
  379. rate = "infinity"
  380. }
  381. }
  382. connection {
  383. capacity = "1000"
  384. initial = "0"
  385. rate = "1000/s"
  386. }
  387. message_in {
  388. capacity = "infinity"
  389. initial = "0"
  390. rate = "infinity"
  391. }
  392. message_routing {
  393. capacity = "infinity"
  394. initial = "0"
  395. rate = "infinity"
  396. }
  397. }
  398. max_connections = 5000000
  399. mountpoint = ""
  400. proxy_protocol = false
  401. proxy_protocol_timeout = "3s"
  402. tcp_options {
  403. active_n = 100
  404. backlog = 1024
  405. buffer = "4KB"
  406. high_watermark = "1MB"
  407. nodelay = true
  408. reuseaddr = true
  409. send_timeout = "15s"
  410. send_timeout_close = true
  411. }
  412. websocket {
  413. allow_origin_absence = true
  414. check_origin_enable = false
  415. check_origins = "http://localhost:18083, http://127.0.0.1:18083"
  416. compress = false
  417. deflate_opts {
  418. client_context_takeover = "takeover"
  419. client_max_window_bits = 15
  420. mem_level = 8
  421. server_context_takeover = "takeover"
  422. server_max_window_bits = 15
  423. strategy = "default"
  424. }
  425. fail_if_no_subprotocol = true
  426. idle_timeout = "7200s"
  427. max_frame_size = "infinity"
  428. mqtt_path = "/mqtt"
  429. mqtt_piggyback = "multiple"
  430. proxy_address_header = "x-forwarded-for"
  431. proxy_port_header = "x-forwarded-port"
  432. supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
  433. }
  434. zone = "default"
  435. }
  436. }
  437. wss {
  438. default {
  439. acceptors = 16
  440. access_rules = ["allow all"]
  441. bind = "0.0.0.0:8084"
  442. enable_authn = true
  443. enabled = true
  444. limiter {
  445. bytes_in {
  446. capacity = "infinity"
  447. initial = "0"
  448. rate = "infinity"
  449. }
  450. client {
  451. bytes_in {
  452. capacity = "infinity"
  453. divisible = false
  454. failure_strategy = "force"
  455. initial = "0"
  456. low_watermark = "0"
  457. max_retry_time = "10s"
  458. rate = "infinity"
  459. }
  460. connection {
  461. capacity = "infinity"
  462. divisible = false
  463. failure_strategy = "force"
  464. initial = "0"
  465. low_watermark = "0"
  466. max_retry_time = "10s"
  467. rate = "infinity"
  468. }
  469. message_in {
  470. capacity = "infinity"
  471. divisible = false
  472. failure_strategy = "force"
  473. initial = "0"
  474. low_watermark = "0"
  475. max_retry_time = "10s"
  476. rate = "infinity"
  477. }
  478. message_routing {
  479. capacity = "infinity"
  480. divisible = false
  481. failure_strategy = "force"
  482. initial = "0"
  483. low_watermark = "0"
  484. max_retry_time = "10s"
  485. rate = "infinity"
  486. }
  487. }
  488. connection {
  489. capacity = "1000"
  490. initial = "0"
  491. rate = "1000/s"
  492. }
  493. message_in {
  494. capacity = "infinity"
  495. initial = "0"
  496. rate = "infinity"
  497. }
  498. message_routing {
  499. capacity = "infinity"
  500. initial = "0"
  501. rate = "infinity"
  502. }
  503. }
  504. max_connections = 5000000
  505. mountpoint = ""
  506. proxy_protocol = false
  507. proxy_protocol_timeout = "3s"
  508. ssl_options {
  509. cacertfile = "${EMQX_ETC_DIR}/certs/cacert.pem"
  510. certfile = "${EMQX_ETC_DIR}/certs/cert.pem"
  511. ciphers = []
  512. client_renegotiation = true
  513. depth = 10
  514. fail_if_no_peer_cert = false
  515. handshake_timeout = "15s"
  516. hibernate_after = "5s"
  517. honor_cipher_order = true
  518. keyfile = "${EMQX_ETC_DIR}/certs/key.pem"
  519. reuse_sessions = true
  520. secure_renegotiate = true
  521. verify = "verify_none"
  522. versions = ["tlsv1.3", "tlsv1.2", "tlsv1.1", "tlsv1"]
  523. }
  524. tcp_options {
  525. active_n = 100
  526. backlog = 1024
  527. buffer = "4KB"
  528. high_watermark = "1MB"
  529. nodelay = true
  530. reuseaddr = true
  531. send_timeout = "15s"
  532. send_timeout_close = true
  533. }
  534. websocket {
  535. allow_origin_absence = true
  536. check_origin_enable = false
  537. check_origins = "http://localhost:18083, http://127.0.0.1:18083"
  538. compress = false
  539. deflate_opts {
  540. client_context_takeover = "takeover"
  541. client_max_window_bits = 15
  542. mem_level = 8
  543. server_context_takeover = "takeover"
  544. server_max_window_bits = 15
  545. strategy = "default"
  546. }
  547. fail_if_no_subprotocol = true
  548. idle_timeout = "7200s"
  549. max_frame_size = "infinity"
  550. mqtt_path = "/mqtt"
  551. mqtt_piggyback = "multiple"
  552. proxy_address_header = "x-forwarded-for"
  553. proxy_port_header = "x-forwarded-port"
  554. supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
  555. }
  556. zone = "default"
  557. }
  558. }
  559. }
  560. log {
  561. console_handler {
  562. burst_limit {
  563. enable = true
  564. max_count = 10000
  565. window_time = "1s"
  566. }
  567. chars_limit = "unlimited"
  568. drop_mode_qlen = 3000
  569. enable = true
  570. flush_qlen = 8000
  571. formatter = "text"
  572. level = "warning"
  573. max_depth = 100
  574. overload_kill {
  575. enable = true
  576. mem_size = "30MB"
  577. qlen = "10000"
  578. restart_after = "5s"
  579. }
  580. single_line = true
  581. supervisor_reports = "error"
  582. sync_mode_qlen = 100
  583. time_offset = "system"
  584. }
  585. file_handlers {
  586. default {
  587. burst_limit {
  588. enable = true
  589. max_count = 10000
  590. window_time = "1s"
  591. }
  592. chars_limit = "unlimited"
  593. drop_mode_qlen = 3000
  594. enable = false
  595. file = "${EMQX_LOG_DIR}/emqx.log"
  596. flush_qlen = 8000
  597. formatter = "text"
  598. level = "warning"
  599. max_depth = 100
  600. max_size = "500MB"
  601. overload_kill {
  602. enable = true
  603. mem_size = "30MB"
  604. qlen = 20000
  605. restart_after = "5s"
  606. }
  607. rotation {count = 10, enable = true}
  608. single_line = true
  609. supervisor_reports = "error"
  610. sync_mode_qlen = 100
  611. time_offset = "system"
  612. }
  613. }
  614. }
  615. mqtt {
  616. await_rel_timeout = "300s"
  617. exclusive_subscription = false
  618. idle_timeout = "15s"
  619. ignore_loop_deliver = false
  620. keepalive_backoff = 0.75
  621. max_awaiting_rel = 100
  622. max_clientid_len = 65535
  623. max_inflight = 32
  624. max_mqueue_len = 1000
  625. max_packet_size = "20MB"
  626. max_qos_allowed = 2
  627. max_subscriptions = "infinity"
  628. max_topic_alias = 65535
  629. max_topic_levels = 128
  630. mqueue_default_priority = "lowest"
  631. mqueue_priorities = "disabled"
  632. "mqueue_store_qos0" = true
  633. peer_cert_as_clientid = "disabled"
  634. peer_cert_as_username = "disabled"
  635. response_information = ""
  636. retain_available = true
  637. retry_interval = "30s"
  638. server_keepalive = "disabled"
  639. session_expiry_interval = "12h"
  640. shared_subscription = true
  641. strict_mode = false
  642. upgrade_qos = false
  643. use_username_as_clientid = false
  644. wildcard_subscription = true
  645. }
  646. retainer {
  647. backend {
  648. index_specs = [
  649. [1, 2, 3],
  650. [1, 3],
  651. [2, 3],
  652. [3]
  653. ]
  654. max_retained_messages = 0
  655. storage_type = "disc"
  656. type = "built_in_database"
  657. }
  658. enable = true
  659. flow_control {
  660. batch_deliver_limiter {
  661. capacity = "infinity"
  662. client {
  663. capacity = "infinity"
  664. divisible = false
  665. failure_strategy = "force"
  666. initial = "0"
  667. low_watermark = "0"
  668. max_retry_time = "10s"
  669. rate = "infinity"
  670. }
  671. initial = "0"
  672. rate = "infinity"
  673. }
  674. batch_deliver_number = 0
  675. batch_read_number = 0
  676. }
  677. max_payload_size = "20MB"
  678. msg_clear_interval = "0s"
  679. msg_expiry_interval = "0s"
  680. stop_publish_clear_msg = false
  681. }
  682. sys_topics {
  683. sys_event_messages {
  684. client_connected = true
  685. client_disconnected = true
  686. client_subscribed = true
  687. client_unsubscribed = false
  688. }
  689. sys_heartbeat_interval = "30s"
  690. sys_msg_interval = "1m"
  691. }
  692. sysmon {
  693. os {
  694. cpu_check_interval = "60s"
  695. cpu_high_watermark = "80%"
  696. cpu_low_watermark = "60%"
  697. mem_check_interval = "60s"
  698. procmem_high_watermark = "5%"
  699. sysmem_high_watermark = "70%"
  700. }
  701. vm {
  702. busy_dist_port = true
  703. busy_port = true
  704. large_heap = "disabled"
  705. long_gc = "disabled"
  706. long_schedule = "240ms"
  707. process_check_interval = "30s"
  708. process_high_watermark = "80%"
  709. process_low_watermark = "60%"
  710. }
  711. }