e5.0.2.conf 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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. tests {
  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"
  76. }
  77. }
  78. }
  79. conn_congestion {enable_alarm = true, min_alarm_sustain_duration = "1m"}
  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. flapping_detect {
  95. ban_time = "5m"
  96. enable = false
  97. max_count = 15
  98. window_time = "1m"
  99. }
  100. force_gc {
  101. bytes = "16MB"
  102. count = 16000
  103. enable = true
  104. }
  105. force_shutdown {
  106. enable = true
  107. max_heap_size = "32MB"
  108. max_message_queue_len = 1000
  109. }
  110. gateway {
  111. coap {
  112. connection_required = false
  113. enable_stats = true
  114. listeners {
  115. udp {
  116. default {
  117. bind = "5683"
  118. max_conn_rate = 1000
  119. max_connections = 1024000
  120. }
  121. }
  122. }
  123. mountpoint = ""
  124. notify_type = "qos"
  125. publish_qos = "coap"
  126. subscribe_qos = "coap"
  127. }
  128. }
  129. limiter {
  130. bytes_in {burst = "0", rate = "infinity"}
  131. client {
  132. bytes_in {
  133. capacity = "infinity"
  134. divisible = false
  135. failure_strategy = "force"
  136. initial = "0"
  137. low_watermark = "0"
  138. max_retry_time = "10s"
  139. rate = "infinity"
  140. }
  141. connection {
  142. capacity = "infinity"
  143. divisible = false
  144. failure_strategy = "force"
  145. initial = "0"
  146. low_watermark = "0"
  147. max_retry_time = "10s"
  148. rate = "infinity"
  149. }
  150. internal {
  151. capacity = "infinity"
  152. divisible = false
  153. failure_strategy = "force"
  154. initial = "0"
  155. low_watermark = "0"
  156. max_retry_time = "10s"
  157. rate = "500"
  158. }
  159. message_in {
  160. capacity = "infinity"
  161. divisible = false
  162. failure_strategy = "force"
  163. initial = "200"
  164. low_watermark = "60"
  165. max_retry_time = "10s"
  166. rate = "100"
  167. }
  168. message_routing {
  169. capacity = "infinity"
  170. divisible = false
  171. failure_strategy = "force"
  172. initial = "0"
  173. low_watermark = "0"
  174. max_retry_time = "10s"
  175. rate = "infinity"
  176. }
  177. }
  178. connection {burst = "0", rate = "infinity"}
  179. internal {burst = "0", rate = "1000"}
  180. message_in {burst = "0", rate = "10000"}
  181. message_routing {burst = "0", rate = "infinity"}
  182. }
  183. listeners {
  184. ssl {
  185. default {
  186. bind = "0.0.0.0:8883"
  187. max_connections = 512000
  188. ssl_options {
  189. cacertfile = "etc/certs/cacert.pem"
  190. certfile = "etc/certs/cert.pem"
  191. keyfile = "etc/certs/key.pem"
  192. }
  193. }
  194. }
  195. tcp {
  196. default {
  197. acceptors = 16
  198. bind = "0.0.0.0:1883"
  199. enable_authn = true
  200. enabled = true
  201. limiter {
  202. bytes_in {
  203. capacity = "infinity"
  204. initial = "0"
  205. rate = "infinity"
  206. }
  207. client {
  208. bytes_in {
  209. capacity = "infinity"
  210. divisible = false
  211. failure_strategy = "force"
  212. initial = "0"
  213. low_watermark = "0"
  214. max_retry_time = "10s"
  215. rate = "infinity"
  216. }
  217. connection {
  218. capacity = "infinity"
  219. divisible = false
  220. failure_strategy = "force"
  221. initial = "0"
  222. low_watermark = "0"
  223. max_retry_time = "10s"
  224. rate = "infinity"
  225. }
  226. message_in {
  227. capacity = "infinity"
  228. divisible = false
  229. failure_strategy = "force"
  230. initial = "0"
  231. low_watermark = "0"
  232. max_retry_time = "10s"
  233. rate = "infinity"
  234. }
  235. message_routing {
  236. capacity = "infinity"
  237. divisible = false
  238. failure_strategy = "force"
  239. initial = "0"
  240. low_watermark = "0"
  241. max_retry_time = "10s"
  242. rate = "infinity"
  243. }
  244. }
  245. connection {
  246. capacity = "1000"
  247. initial = "0"
  248. rate = "1000/s"
  249. }
  250. message_in {
  251. capacity = "infinity"
  252. initial = "0"
  253. rate = "infinity"
  254. }
  255. message_routing {
  256. capacity = "infinity"
  257. initial = "0"
  258. rate = "infinity"
  259. }
  260. }
  261. max_connections = 1024000
  262. mountpoint = "topic_prefix1/x"
  263. proxy_protocol = false
  264. proxy_protocol_timeout = "3s"
  265. tcp_options {
  266. active_n = 100
  267. backlog = 1024
  268. buffer = "4KB"
  269. high_watermark = "1MB"
  270. nodelay = true
  271. reuseaddr = true
  272. send_timeout = "15s"
  273. send_timeout_close = true
  274. }
  275. zone = "default"
  276. }
  277. }
  278. ws {
  279. default {
  280. bind = "0.0.0.0:8083"
  281. max_connections = 1024000
  282. websocket {mqtt_path = "/mqtt"}
  283. }
  284. }
  285. wss {
  286. default {
  287. bind = "0.0.0.0:8084"
  288. max_connections = 512000
  289. ssl_options {
  290. cacertfile = "etc/certs/cacert.pem"
  291. certfile = "etc/certs/cert.pem"
  292. keyfile = "etc/certs/key.pem"
  293. }
  294. websocket {mqtt_path = "/mqtt"}
  295. }
  296. }
  297. }
  298. log {
  299. console_handler {
  300. burst_limit {
  301. enable = true
  302. max_count = 10000
  303. window_time = "1s"
  304. }
  305. chars_limit = "unlimited"
  306. drop_mode_qlen = 3000
  307. enable = true
  308. flush_qlen = 8000
  309. formatter = "text"
  310. level = "info"
  311. max_depth = 100
  312. overload_kill {
  313. enable = true
  314. mem_size = "30MB"
  315. qlen = "10000"
  316. restart_after = "5s"
  317. }
  318. single_line = true
  319. supervisor_reports = "error"
  320. sync_mode_qlen = 100
  321. time_offset = "system"
  322. }
  323. file_handlers {
  324. default {
  325. burst_limit {
  326. enable = true
  327. max_count = 10000
  328. window_time = "1s"
  329. }
  330. chars_limit = "unlimited"
  331. drop_mode_qlen = 3000
  332. enable = true
  333. file = "log/emqx.log"
  334. flush_qlen = 8000
  335. formatter = "text"
  336. level = "warning"
  337. max_depth = 100
  338. max_size = "1000MB"
  339. overload_kill {
  340. enable = true
  341. mem_size = "30MB"
  342. qlen = 20000
  343. restart_after = "5s"
  344. }
  345. rotation {count = 10, enable = true}
  346. single_line = true
  347. supervisor_reports = "error"
  348. sync_mode_qlen = 100
  349. time_offset = "system"
  350. }
  351. }
  352. }
  353. mqtt {
  354. await_rel_timeout = "300s"
  355. exclusive_subscription = false
  356. idle_timeout = "15s"
  357. ignore_loop_deliver = false
  358. keepalive_backoff = 0.75
  359. max_awaiting_rel = 100
  360. max_clientid_len = 65535
  361. max_inflight = 8
  362. max_mqueue_len = 1000
  363. max_packet_size = "1MB"
  364. max_qos_allowed = 2
  365. max_subscriptions = "infinity"
  366. max_topic_alias = 1024
  367. max_topic_levels = 128
  368. mqueue_default_priority = "lowest"
  369. mqueue_priorities = "disabled"
  370. "mqueue_store_qos0" = true
  371. peer_cert_as_clientid = "disabled"
  372. peer_cert_as_username = "disabled"
  373. response_information = ""
  374. retain_available = true
  375. retry_interval = "30s"
  376. server_keepalive = "disabled"
  377. session_expiry_interval = "2h"
  378. shared_subscription = true
  379. strict_mode = false
  380. upgrade_qos = false
  381. use_username_as_clientid = false
  382. wildcard_subscription = true
  383. }
  384. overload_protection {
  385. backoff_delay = 1
  386. backoff_gc = false
  387. backoff_hibernation = true
  388. backoff_new_conn = true
  389. enable = false
  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 = 0
  400. storage_type = "disc"
  401. type = "built_in_database"
  402. }
  403. enable = true
  404. flow_control {
  405. batch_deliver_limiter {
  406. capacity = "infinity"
  407. client {
  408. capacity = "infinity"
  409. divisible = false
  410. failure_strategy = "force"
  411. initial = "0"
  412. low_watermark = "0"
  413. max_retry_time = "10s"
  414. rate = "infinity"
  415. }
  416. initial = "0"
  417. rate = "infinity"
  418. }
  419. batch_deliver_number = 0
  420. batch_read_number = 0
  421. }
  422. max_payload_size = "1MB"
  423. msg_clear_interval = "0s"
  424. msg_expiry_interval = "120s"
  425. stop_publish_clear_msg = false
  426. }
  427. rule_engine {
  428. ignore_sys_message = true
  429. jq_function_default_timeout = "10s"
  430. jq_implementation_module = "jq_nif"
  431. rules {
  432. "rule_bx87" {
  433. actions = ["webhook:tests"]
  434. description = ""
  435. metadata {created_at = 1683880400358}
  436. sql = "SELECT\n *\nFROM\n \"t/#\""
  437. }
  438. }
  439. }
  440. stats {enable = true}
  441. sys_topics {
  442. sys_event_messages {
  443. client_connected = true
  444. client_disconnected = true
  445. client_subscribed = true
  446. client_unsubscribed = true
  447. }
  448. sys_heartbeat_interval = "30s"
  449. sys_msg_interval = "1m"
  450. }