v5.0.24.conf 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. authentication = [
  17. {
  18. backend = "built_in_database"
  19. mechanism = "password_based"
  20. password_hash_algorithm {name = "sha256", salt_position = "suffix"}
  21. user_id_type = "username"
  22. }
  23. ]
  24. authorization {
  25. cache {enable = true}
  26. deny_action = "ignore"
  27. no_match = "allow"
  28. sources = [
  29. {
  30. body {username = "${username}"}
  31. connect_timeout = "15s"
  32. enable_pipelining = 100
  33. headers {"content-type" = "application/json"}
  34. method = "post"
  35. pool_size = 8
  36. request_timeout = "30s"
  37. ssl {enable = false, verify = "verify_peer"}
  38. type = "http"
  39. url = "http://127.0.0.1:8080"
  40. },
  41. {
  42. enable = true
  43. path = "etc/acl.conf"
  44. type = "file"
  45. }
  46. ]
  47. }
  48. bridges {
  49. webhook {
  50. test {
  51. connect_timeout = "15s"
  52. enable_pipelining = 100
  53. headers {"content-type" = "application/json"}
  54. method = "post"
  55. pool_size = 8
  56. pool_type = "random"
  57. request_timeout = "15s"
  58. resource_opts {
  59. async_inflight_window = 100
  60. auto_restart_interval = "60s"
  61. health_check_interval = "15s"
  62. max_queue_bytes = "1GB"
  63. query_mode = "async"
  64. request_timeout = "15s"
  65. worker_pool_size = 4
  66. }
  67. ssl {enable = false, verify = "verify_peer"}
  68. url = "http://127.0.0.1:8080/webhook"
  69. }
  70. }
  71. }
  72. exhook {
  73. servers = [
  74. {
  75. auto_reconnect = "60s"
  76. enable = false
  77. failed_action = "deny"
  78. name = "test"
  79. pool_size = 16
  80. request_timeout = "5s"
  81. ssl {enable = false, verify = "verify_peer"}
  82. url = "http://127.0.0.1:8080"
  83. }
  84. ]
  85. }
  86. gateway {
  87. coap {
  88. connection_required = false
  89. enable_stats = true
  90. listeners {
  91. udp {
  92. default {
  93. bind = "5683"
  94. max_conn_rate = 1000
  95. max_connections = 1024000
  96. }
  97. }
  98. }
  99. mountpoint = ""
  100. notify_type = "qos"
  101. publish_qos = "coap"
  102. subscribe_qos = "coap"
  103. }
  104. }
  105. listeners {
  106. ssl {
  107. default {
  108. bind = "0.0.0.0:8883"
  109. max_connections = 512000
  110. ssl_options {
  111. cacertfile = "etc/certs/cacert.pem"
  112. certfile = "etc/certs/cert.pem"
  113. keyfile = "etc/certs/key.pem"
  114. }
  115. }
  116. }
  117. tcp {
  118. default {
  119. acceptors = 16
  120. bind = "0.0.0.0:1883"
  121. enable_authn = true
  122. enabled = true
  123. limiter {
  124. bytes {rate = "infinity"}
  125. client {
  126. bytes {rate = "infinity"}
  127. messages {rate = "infinity"}
  128. }
  129. messages {rate = "infinity"}
  130. }
  131. max_connections = 5000
  132. proxy_protocol = false
  133. proxy_protocol_timeout = "3s"
  134. tcp_options {
  135. active_n = 100
  136. backlog = 1024
  137. buffer = "4KB"
  138. high_watermark = "1MB"
  139. nodelay = true
  140. reuseaddr = true
  141. send_timeout = "15s"
  142. send_timeout_close = true
  143. }
  144. zone = "default"
  145. }
  146. }
  147. ws {
  148. default {
  149. bind = "0.0.0.0:8083"
  150. max_connections = 1024000
  151. websocket {mqtt_path = "/mqtt"}
  152. }
  153. }
  154. wss {
  155. default {
  156. bind = "0.0.0.0:8084"
  157. max_connections = 512000
  158. ssl_options {
  159. cacertfile = "etc/certs/cacert.pem"
  160. certfile = "etc/certs/cert.pem"
  161. keyfile = "etc/certs/key.pem"
  162. }
  163. websocket {mqtt_path = "/mqtt"}
  164. }
  165. }
  166. }
  167. log {
  168. console_handler {
  169. burst_limit {
  170. enable = true
  171. max_count = 10000
  172. window_time = "1s"
  173. }
  174. chars_limit = "unlimited"
  175. drop_mode_qlen = 3000
  176. enable = true
  177. flush_qlen = 8000
  178. formatter = "text"
  179. level = "warning"
  180. max_depth = 100
  181. overload_kill {
  182. enable = true
  183. mem_size = "30MB"
  184. qlen = "10000"
  185. restart_after = "5s"
  186. }
  187. single_line = true
  188. supervisor_reports = "error"
  189. sync_mode_qlen = 100
  190. time_offset = "system"
  191. }
  192. file_handlers {
  193. default {
  194. burst_limit {
  195. enable = true
  196. max_count = 10000
  197. window_time = "1s"
  198. }
  199. chars_limit = "unlimited"
  200. drop_mode_qlen = 3000
  201. enable = false
  202. file = "log/emqx.log"
  203. flush_qlen = 8000
  204. formatter = "text"
  205. level = "info"
  206. max_depth = 100
  207. max_size = "50MB"
  208. overload_kill {
  209. enable = true
  210. mem_size = "30MB"
  211. qlen = 20000
  212. restart_after = "5s"
  213. }
  214. rotation {count = 10, enable = true}
  215. single_line = true
  216. supervisor_reports = "error"
  217. sync_mode_qlen = 100
  218. time_offset = "system"
  219. }
  220. }
  221. }
  222. mqtt {
  223. await_rel_timeout = "300s"
  224. exclusive_subscription = false
  225. idle_timeout = "15s"
  226. ignore_loop_deliver = false
  227. keepalive_backoff = 0.75
  228. max_awaiting_rel = 100
  229. max_clientid_len = 65535
  230. max_inflight = 32
  231. max_mqueue_len = 1000
  232. max_packet_size = "10MB"
  233. max_qos_allowed = 2
  234. max_subscriptions = "infinity"
  235. max_topic_alias = 65535
  236. max_topic_levels = 128
  237. mqueue_default_priority = "lowest"
  238. mqueue_priorities = "disabled"
  239. "mqueue_store_qos0" = true
  240. peer_cert_as_clientid = "disabled"
  241. peer_cert_as_username = "disabled"
  242. response_information = ""
  243. retain_available = true
  244. retry_interval = "30s"
  245. server_keepalive = "disabled"
  246. session_expiry_interval = "12h"
  247. shared_subscription = true
  248. strict_mode = false
  249. upgrade_qos = false
  250. use_username_as_clientid = false
  251. wildcard_subscription = true
  252. }
  253. retainer {
  254. backend {
  255. index_specs = [
  256. [1, 2, 3],
  257. [1, 3],
  258. [2, 3],
  259. [3]
  260. ]
  261. max_retained_messages = 0
  262. storage_type = "ram"
  263. type = "built_in_database"
  264. }
  265. enable = true
  266. max_payload_size = "10MB"
  267. msg_clear_interval = "0s"
  268. msg_expiry_interval = "0s"
  269. stop_publish_clear_msg = false
  270. }
  271. rule_engine {
  272. ignore_sys_message = true
  273. jq_function_default_timeout = "10s"
  274. rules {
  275. "rule_s56b" {
  276. actions = ["webhook:test"]
  277. description = ""
  278. metadata {created_at = 1683882654432}
  279. sql = "SELECT\n *\nFROM\n \"t/#\""
  280. }
  281. }
  282. }
  283. sys_topics {
  284. sys_event_messages {
  285. client_connected = true
  286. client_disconnected = true
  287. client_subscribed = true
  288. client_unsubscribed = true
  289. }
  290. sys_heartbeat_interval = "30s"
  291. sys_msg_interval = "1m"
  292. }