e5.0.0.conf 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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. listeners.tcp.default {
  17. bind = "0.0.0.0:1883"
  18. max_connections = 1024000
  19. }
  20. listeners.ssl.default {
  21. bind = "0.0.0.0:8883"
  22. max_connections = 512000
  23. ssl_options {
  24. keyfile = "etc/certs/key.pem"
  25. certfile = "etc/certs/cert.pem"
  26. cacertfile = "etc/certs/cacert.pem"
  27. }
  28. }
  29. listeners.ws.default {
  30. bind = "0.0.0.0:8083"
  31. max_connections = 1024000
  32. websocket.mqtt_path = "/mqtt"
  33. }
  34. listeners.wss.default {
  35. bind = "0.0.0.0:8084"
  36. max_connections = 512000
  37. websocket.mqtt_path = "/mqtt"
  38. ssl_options {
  39. keyfile = "etc/certs/key.pem"
  40. certfile = "etc/certs/cert.pem"
  41. cacertfile = "etc/certs/cacert.pem"
  42. }
  43. }
  44. dashboard {
  45. listeners.http {
  46. bind = 18083
  47. }
  48. default_username = "admin"
  49. default_password = "public"
  50. }
  51. authentication = [
  52. {
  53. backend = "built_in_database"
  54. mechanism = "password_based"
  55. password_hash_algorithm {name = "sha256", salt_position = "suffix"}
  56. user_id_type = "username"
  57. }
  58. ]
  59. authorization {
  60. cache {enable = true}
  61. deny_action = "ignore"
  62. no_match = "allow"
  63. sources = [
  64. {
  65. body {username = "${username}"}
  66. connect_timeout = "5s"
  67. enable_pipelining = 100
  68. headers {"content-type" = "application/json"}
  69. method = "post"
  70. pool_size = 8
  71. request_timeout = "5s"
  72. ssl {enable = false, verify = "verify_peer"}
  73. type = "http"
  74. url = "http://127.0.0.1:8080"
  75. },
  76. {
  77. enable = true
  78. path = "etc/acl.conf"
  79. type = "file"
  80. }
  81. ]
  82. }
  83. bridges {
  84. webhook {
  85. default {
  86. connect_timeout = "5s"
  87. enable_pipelining = 100
  88. headers {"content-type" = "application/json"}
  89. method = "post"
  90. pool_size = 4
  91. pool_type = "random"
  92. request_timeout = "5s"
  93. resource_opts {
  94. async_inflight_window = 100
  95. auto_restart_interval = "60s"
  96. health_check_interval = "15s"
  97. max_queue_bytes = "1GB"
  98. query_mode = "async"
  99. request_timeout = "15s"
  100. worker_pool_size = 4
  101. }
  102. ssl {enable = false, verify = "verify_peer"}
  103. url = "http://127.0.0.1:8080/webhook"
  104. }
  105. }
  106. }
  107. conn_congestion {enable_alarm = true, min_alarm_sustain_duration = "1m"}
  108. exhook {
  109. servers = [
  110. {
  111. auto_reconnect = "60s"
  112. enable = false
  113. failed_action = "deny"
  114. name = "exhook"
  115. pool_size = 16
  116. request_timeout = "5s"
  117. ssl {enable = false, verify = "verify_peer"}
  118. url = "http://127.0.0.1:8000"
  119. }
  120. ]
  121. }
  122. flapping_detect {
  123. ban_time = "5m"
  124. enable = false
  125. max_count = 15
  126. window_time = "1m"
  127. }
  128. force_gc {
  129. bytes = "16MB"
  130. count = 16000
  131. enable = true
  132. }
  133. force_shutdown {
  134. enable = true
  135. max_heap_size = "32MB"
  136. max_message_queue_len = 1000
  137. }
  138. gateway {
  139. stomp {
  140. enable_stats = true
  141. frame {
  142. max_body_length = 8192
  143. max_headers = 10
  144. max_headers_length = 1024
  145. }
  146. idle_timeout = "30s"
  147. listeners {
  148. tcp {
  149. default {
  150. bind = "61613"
  151. max_conn_rate = 1000
  152. max_connections = 1024000
  153. }
  154. }
  155. }
  156. mountpoint = ""
  157. }
  158. }
  159. limiter {
  160. bytes_in {burst = "1000", rate = "infinity"}
  161. client {
  162. bytes_in {
  163. capacity = "infinity"
  164. divisible = false
  165. failure_strategy = "force"
  166. initial = "0"
  167. low_watermark = "0"
  168. max_retry_time = "10s"
  169. rate = "1000KB/s"
  170. }
  171. connection {
  172. capacity = "infinity"
  173. divisible = false
  174. failure_strategy = "force"
  175. initial = "0"
  176. low_watermark = "0"
  177. max_retry_time = "10s"
  178. rate = "1000"
  179. }
  180. internal {
  181. capacity = "infinity"
  182. divisible = false
  183. failure_strategy = "force"
  184. initial = "0"
  185. low_watermark = "0"
  186. max_retry_time = "10s"
  187. rate = "infinity"
  188. }
  189. message_in {
  190. capacity = "infinity"
  191. divisible = false
  192. failure_strategy = "force"
  193. initial = "0"
  194. low_watermark = "0"
  195. max_retry_time = "10s"
  196. rate = "1000"
  197. }
  198. message_routing {
  199. capacity = "infinity"
  200. divisible = false
  201. failure_strategy = "force"
  202. initial = "0"
  203. low_watermark = "0"
  204. max_retry_time = "10s"
  205. rate = "infinity"
  206. }
  207. }
  208. connection {burst = 0, rate = "infinity"}
  209. internal {burst = 0, rate = "infinity"}
  210. message_in {burst = 0, rate = "infinity"}
  211. message_routing {burst = 0, rate = "1000"}
  212. }
  213. log {
  214. console_handler {
  215. burst_limit {
  216. enable = true
  217. max_count = 10000
  218. window_time = "1s"
  219. }
  220. chars_limit = "unlimited"
  221. drop_mode_qlen = 3000
  222. enable = true
  223. flush_qlen = 8000
  224. formatter = "text"
  225. level = "info"
  226. max_depth = 100
  227. overload_kill {
  228. enable = true
  229. mem_size = "30MB"
  230. qlen = 20000
  231. restart_after = "5s"
  232. }
  233. single_line = true
  234. supervisor_reports = "error"
  235. sync_mode_qlen = 100
  236. time_offset = "system"
  237. }
  238. file_handlers {
  239. default {
  240. burst_limit {
  241. enable = true
  242. max_count = 10000
  243. window_time = "1s"
  244. }
  245. chars_limit = "unlimited"
  246. drop_mode_qlen = 3000
  247. enable = false
  248. file = "log/emqx.log"
  249. flush_qlen = 8000
  250. formatter = "text"
  251. level = "warning"
  252. max_depth = 100
  253. max_size = "50MB"
  254. overload_kill {
  255. enable = true
  256. mem_size = "30MB"
  257. qlen = 20000
  258. restart_after = "5s"
  259. }
  260. rotation {count = 10, enable = true}
  261. single_line = true
  262. supervisor_reports = "error"
  263. sync_mode_qlen = 100
  264. time_offset = "system"
  265. }
  266. }
  267. }
  268. mqtt {
  269. await_rel_timeout = "300s"
  270. exclusive_subscription = false
  271. idle_timeout = "15s"
  272. ignore_loop_deliver = false
  273. keepalive_backoff = 0.5
  274. max_awaiting_rel = 100
  275. max_clientid_len = 65535
  276. max_inflight = 32
  277. max_mqueue_len = 1000
  278. max_packet_size = "1MB"
  279. max_qos_allowed = 2
  280. max_subscriptions = "infinity"
  281. max_topic_alias = 65535
  282. max_topic_levels = 128
  283. mqueue_default_priority = "lowest"
  284. mqueue_priorities = "disabled"
  285. "mqueue_store_qos0" = true
  286. peer_cert_as_clientid = "disabled"
  287. peer_cert_as_username = "disabled"
  288. response_information = ""
  289. retain_available = true
  290. retry_interval = "30s"
  291. server_keepalive = "disabled"
  292. session_expiry_interval = "2h"
  293. shared_subscription = true
  294. strict_mode = false
  295. upgrade_qos = false
  296. use_username_as_clientid = false
  297. wildcard_subscription = true
  298. }
  299. overload_protection {
  300. backoff_delay = 1
  301. backoff_gc = false
  302. backoff_hibernation = true
  303. backoff_new_conn = true
  304. enable = false
  305. }
  306. retainer {
  307. backend {
  308. index_specs = [
  309. [1, 2, 3],
  310. [1, 3],
  311. [2, 3],
  312. [3]
  313. ]
  314. max_retained_messages = 0
  315. storage_type = "ram"
  316. type = "built_in_database"
  317. }
  318. enable = true
  319. flow_control {
  320. batch_deliver_limiter {
  321. capacity = "infinity"
  322. client {
  323. capacity = "infinity"
  324. divisible = false
  325. failure_strategy = "force"
  326. initial = "0"
  327. low_watermark = "0"
  328. max_retry_time = "10s"
  329. rate = "infinity"
  330. }
  331. initial = "0"
  332. rate = "infinity"
  333. }
  334. batch_deliver_number = 0
  335. batch_read_number = 0
  336. }
  337. max_payload_size = "10MB"
  338. msg_clear_interval = "0s"
  339. msg_expiry_interval = "0s"
  340. stop_publish_clear_msg = false
  341. }
  342. rule_engine {
  343. ignore_sys_message = true
  344. jq_function_default_timeout = "10s"
  345. jq_implementation_module = "jq_nif"
  346. rules {
  347. "rule_k9y8" {
  348. actions = ["webhook:default"]
  349. description = ""
  350. metadata {created_at = 1683875156258}
  351. sql = "SELECT\n *\nFROM\n \"t/#\""
  352. }
  353. }
  354. }
  355. stats {enable = true}
  356. sys_topics {
  357. sys_event_messages {
  358. client_connected = true
  359. client_disconnected = false
  360. client_subscribed = false
  361. client_unsubscribed = false
  362. }
  363. sys_heartbeat_interval = "30s"
  364. sys_msg_interval = "1m"
  365. }