v5.0.22.conf 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. node {
  2. name = "emqx@127.0.0.1"
  3. cookie = "emqxsecretcookie"
  4. data_dir = "data"
  5. }
  6. log {
  7. file_handlers.default {
  8. level = warning
  9. file = "log/emqx.log"
  10. }
  11. }
  12. cluster {
  13. name = emqxcl
  14. discovery_strategy = manual
  15. }
  16. dashboard {
  17. listeners.http {
  18. bind = 18083
  19. }
  20. default_username = "admin"
  21. default_password = "public"
  22. }
  23. authentication = [
  24. {
  25. backend = "built_in_database"
  26. mechanism = "password_based"
  27. password_hash_algorithm {name = "sha256", salt_position = "suffix"}
  28. user_id_type = "username"
  29. }
  30. ]
  31. authorization {
  32. cache {enable = true}
  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 = "etc/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. async_inflight_window = 100
  67. auto_restart_interval = "60s"
  68. health_check_interval = "15s"
  69. max_queue_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. conn_congestion {enable_alarm = true, min_alarm_sustain_duration = "1m"}
  80. delayed {enable = true, max_delayed_messages = 1000}
  81. exhook {
  82. servers = [
  83. {
  84. auto_reconnect = "60s"
  85. enable = false
  86. failed_action = "deny"
  87. name = "test"
  88. pool_size = 16
  89. request_timeout = "5s"
  90. ssl {enable = false, verify = "verify_peer"}
  91. url = "http://127.0.0.1:8080"
  92. }
  93. ]
  94. }
  95. flapping_detect {
  96. ban_time = "5m"
  97. enable = false
  98. max_count = 15
  99. window_time = "1m"
  100. }
  101. force_gc {
  102. bytes = "16MB"
  103. count = 16000
  104. enable = true
  105. }
  106. force_shutdown {
  107. enable = true
  108. max_heap_size = "32MB"
  109. max_message_queue_len = 1000
  110. }
  111. gateway {
  112. mqttsn {
  113. broadcast = true
  114. "enable_qos3" = true
  115. enable_stats = true
  116. gateway_id = 1
  117. idle_timeout = "30s"
  118. listeners {
  119. udp {
  120. default {
  121. bind = "1884"
  122. max_conn_rate = 1000
  123. max_connections = 1024000
  124. }
  125. }
  126. }
  127. mountpoint = ""
  128. predefined = []
  129. }
  130. }
  131. limiter {
  132. bytes_in {burst = "0", rate = "10MB/s"}
  133. client {
  134. bytes_in {
  135. capacity = "infinity"
  136. divisible = false
  137. failure_strategy = "force"
  138. initial = "100KB"
  139. low_watermark = "0"
  140. max_retry_time = "10s"
  141. rate = "2000"
  142. }
  143. connection {
  144. capacity = "infinity"
  145. divisible = false
  146. failure_strategy = "force"
  147. initial = "0"
  148. low_watermark = "0"
  149. max_retry_time = "10s"
  150. rate = "infinity"
  151. }
  152. internal {
  153. capacity = "infinity"
  154. divisible = false
  155. failure_strategy = "force"
  156. initial = "0"
  157. low_watermark = "0"
  158. max_retry_time = "10s"
  159. rate = "infinity"
  160. }
  161. message_in {
  162. capacity = "infinity"
  163. divisible = false
  164. failure_strategy = "force"
  165. initial = "0"
  166. low_watermark = "0"
  167. max_retry_time = "10s"
  168. rate = "infinity"
  169. }
  170. message_routing {
  171. capacity = "infinity"
  172. divisible = false
  173. failure_strategy = "force"
  174. initial = "0"
  175. low_watermark = "0"
  176. max_retry_time = "10s"
  177. rate = "infinity"
  178. }
  179. }
  180. connection {burst = "0", rate = "infinity"}
  181. internal {burst = "1000", rate = "1000/s"}
  182. message_in {burst = "0", rate = "infinity"}
  183. message_routing {burst = "0", rate = "2000/m"}
  184. }
  185. listeners {
  186. ssl {
  187. default {
  188. bind = "0.0.0.0:8883"
  189. max_connections = 512000
  190. ssl_options {
  191. cacertfile = "etc/certs/cacert.pem"
  192. certfile = "etc/certs/cert.pem"
  193. keyfile = "etc/certs/key.pem"
  194. }
  195. }
  196. }
  197. tcp {
  198. default {bind = "0.0.0.0:1883", max_connections = 1024000}
  199. }
  200. ws {
  201. default {
  202. acceptors = 32
  203. bind = "0.0.0.0:8083"
  204. enable_authn = true
  205. enabled = true
  206. limiter {
  207. bytes_in {
  208. capacity = "infinity"
  209. initial = "0"
  210. rate = "infinity"
  211. }
  212. client {
  213. bytes_in {
  214. capacity = "infinity"
  215. divisible = false
  216. failure_strategy = "force"
  217. initial = "0"
  218. low_watermark = "0"
  219. max_retry_time = "10s"
  220. rate = "infinity"
  221. }
  222. connection {
  223. capacity = "infinity"
  224. divisible = false
  225. failure_strategy = "force"
  226. initial = "0"
  227. low_watermark = "0"
  228. max_retry_time = "10s"
  229. rate = "infinity"
  230. }
  231. message_in {
  232. capacity = "infinity"
  233. divisible = false
  234. failure_strategy = "force"
  235. initial = "0"
  236. low_watermark = "0"
  237. max_retry_time = "10s"
  238. rate = "infinity"
  239. }
  240. message_routing {
  241. capacity = "infinity"
  242. divisible = false
  243. failure_strategy = "force"
  244. initial = "0"
  245. low_watermark = "0"
  246. max_retry_time = "10s"
  247. rate = "infinity"
  248. }
  249. }
  250. connection {
  251. capacity = "1000"
  252. initial = "0"
  253. rate = "1000/s"
  254. }
  255. message_in {
  256. capacity = "infinity"
  257. initial = "0"
  258. rate = "infinity"
  259. }
  260. message_routing {
  261. capacity = "infinity"
  262. initial = "0"
  263. rate = "infinity"
  264. }
  265. }
  266. max_connections = 1024000
  267. proxy_protocol = false
  268. proxy_protocol_timeout = "3s"
  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. wss {
  305. default {
  306. bind = "0.0.0.0:8084"
  307. max_connections = 512000
  308. ssl_options {
  309. cacertfile = "etc/certs/cacert.pem"
  310. certfile = "etc/certs/cert.pem"
  311. keyfile = "etc/certs/key.pem"
  312. }
  313. websocket {mqtt_path = "/mqtt"}
  314. }
  315. }
  316. }
  317. log {
  318. console_handler {
  319. burst_limit {
  320. enable = true
  321. max_count = 10000
  322. window_time = "1s"
  323. }
  324. chars_limit = 1000
  325. drop_mode_qlen = 3000
  326. enable = true
  327. flush_qlen = 8000
  328. formatter = "text"
  329. level = "warning"
  330. max_depth = "unlimited"
  331. overload_kill {
  332. enable = true
  333. mem_size = "30MB"
  334. qlen = 20000
  335. restart_after = "5s"
  336. }
  337. single_line = true
  338. supervisor_reports = "error"
  339. sync_mode_qlen = 100
  340. time_offset = "system"
  341. }
  342. file_handlers {
  343. default {
  344. burst_limit {
  345. enable = true
  346. max_count = 10000
  347. window_time = "1s"
  348. }
  349. chars_limit = "unlimited"
  350. drop_mode_qlen = 3000
  351. enable = false
  352. file = "log/emqx.log"
  353. flush_qlen = 8000
  354. formatter = "text"
  355. level = "warning"
  356. max_depth = 100
  357. max_size = "50MB"
  358. overload_kill {
  359. enable = true
  360. mem_size = "30MB"
  361. qlen = 20000
  362. restart_after = "5s"
  363. }
  364. rotation {count = 10, enable = true}
  365. single_line = true
  366. supervisor_reports = "error"
  367. sync_mode_qlen = 100
  368. time_offset = "system"
  369. }
  370. }
  371. }
  372. mqtt {
  373. await_rel_timeout = "300s"
  374. exclusive_subscription = true
  375. idle_timeout = "15s"
  376. ignore_loop_deliver = true
  377. keepalive_backoff = 1
  378. max_awaiting_rel = 100
  379. max_clientid_len = 65535
  380. max_inflight = 32
  381. max_mqueue_len = 1000
  382. max_packet_size = "10MB"
  383. max_qos_allowed = 2
  384. max_subscriptions = 2000
  385. max_topic_alias = 65535
  386. max_topic_levels = 128
  387. mqueue_default_priority = "lowest"
  388. mqueue_priorities = "disabled"
  389. "mqueue_store_qos0" = true
  390. peer_cert_as_clientid = "disabled"
  391. peer_cert_as_username = "disabled"
  392. response_information = ""
  393. retain_available = true
  394. retry_interval = "30s"
  395. server_keepalive = 20
  396. session_expiry_interval = "2h"
  397. shared_subscription = true
  398. strict_mode = false
  399. upgrade_qos = true
  400. use_username_as_clientid = true
  401. wildcard_subscription = true
  402. }
  403. overload_protection {
  404. backoff_delay = 1
  405. backoff_gc = false
  406. backoff_hibernation = true
  407. backoff_new_conn = true
  408. enable = false
  409. }
  410. retainer {
  411. backend {
  412. index_specs = [
  413. [1, 2, 3],
  414. [1, 3],
  415. [2, 3],
  416. [3]
  417. ]
  418. max_retained_messages = 2000
  419. storage_type = "ram"
  420. type = "built_in_database"
  421. }
  422. enable = true
  423. flow_control {
  424. batch_deliver_limiter {
  425. capacity = "infinity"
  426. client {
  427. capacity = "infinity"
  428. divisible = false
  429. failure_strategy = "force"
  430. initial = "0"
  431. low_watermark = "0"
  432. max_retry_time = "10s"
  433. rate = "infinity"
  434. }
  435. initial = "0"
  436. rate = "infinity"
  437. }
  438. batch_deliver_number = 0
  439. batch_read_number = 0
  440. }
  441. max_payload_size = "1MB"
  442. msg_clear_interval = "2000ms"
  443. msg_expiry_interval = "1000ms"
  444. stop_publish_clear_msg = false
  445. }
  446. rule_engine {
  447. ignore_sys_message = true
  448. jq_function_default_timeout = "10s"
  449. rules {
  450. "rule_fhd9" {
  451. actions = ["webhook:test"]
  452. description = ""
  453. metadata {created_at = 1684225481677}
  454. sql = "SELECT\n *\nFROM\n \"t/#\""
  455. }
  456. }
  457. }
  458. stats {enable = true}
  459. sys_topics {
  460. sys_event_messages {
  461. client_connected = true
  462. client_disconnected = true
  463. client_subscribed = true
  464. client_unsubscribed = true
  465. }
  466. sys_heartbeat_interval = "30s"
  467. sys_msg_interval = "1m"
  468. }
  469. sysmon {
  470. os {
  471. cpu_check_interval = "60s"
  472. cpu_high_watermark = "80%"
  473. cpu_low_watermark = "60%"
  474. mem_check_interval = "60s"
  475. procmem_high_watermark = "5%"
  476. sysmem_high_watermark = "70%"
  477. }
  478. top {
  479. db_hostname = ""
  480. db_name = "postgres"
  481. db_password = "******"
  482. db_port = 5432
  483. db_username = "system_monitor"
  484. max_procs = 1000000
  485. num_items = 10
  486. sample_interval = "2s"
  487. }
  488. vm {
  489. busy_dist_port = false
  490. busy_port = false
  491. large_heap = "disabled"
  492. long_gc = "disabled"
  493. long_schedule = "disabled"
  494. process_check_interval = "30s"
  495. process_high_watermark = "80%"
  496. process_low_watermark = "60%"
  497. }
  498. }