From 53fdda8eef99f9365e85b8db128249a7d2e621b0 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Tue, 20 Jun 2023 17:52:03 +0800 Subject: [PATCH] chore: more detail for examples --- examples/auto_subscribe.conf.example | 30 ----------------- examples/listeners.ssl.conf.example | 29 ++++++++++++++-- examples/listeners.ws.conf.example | 17 ++++++++++ examples/listeners.wss.conf.example | 41 ++++++++++++++++++++++- examples/log.file.conf.example | 2 +- examples/node.conf.example | 2 +- examples/overload_protection.conf.example | 25 -------------- examples/slow_subs.conf.example | 28 ---------------- examples/sysmon.os.conf.example | 12 +++---- examples/sysmon.vm.conf.example | 6 ++-- 10 files changed, 95 insertions(+), 97 deletions(-) delete mode 100644 examples/auto_subscribe.conf.example delete mode 100644 examples/overload_protection.conf.example delete mode 100644 examples/slow_subs.conf.example diff --git a/examples/auto_subscribe.conf.example b/examples/auto_subscribe.conf.example deleted file mode 100644 index 7a5523f2a..000000000 --- a/examples/auto_subscribe.conf.example +++ /dev/null @@ -1,30 +0,0 @@ -##-------------------------------------------------------------------- -## Auto Subscribe -## -## Subscribe the Topics automatically when client connected -##-------------------------------------------------------------------- - -auto_subscribe.topics = [ - { - ## Topic name, placeholders are supported - ## For example: client/${clientid}/username/${username}/host/${host}/port/${port} - topic = "/auto/${clientid}", - - ## QoS - qos = 0, - - ## Retain Handling - ## Value: 0 | 1 | 2 - rh = 0, - - ## Retain As Publish - ## Value: 0 | 1 - rap = 0, - - ## No Local - ## Value: 0 | 1 - nl = 0 - }, - {topic = "/foo/${username}/#", qos = 1}, - {topic = "/boo/${ip}/+"} -] diff --git a/examples/listeners.ssl.conf.example b/examples/listeners.ssl.conf.example index e86bd6b4d..11078db6c 100644 --- a/examples/listeners.ssl.conf.example +++ b/examples/listeners.ssl.conf.example @@ -13,7 +13,24 @@ listeners.ssl.sslname { ## Port or Address to listen on, 0 means disable bind = 8883 ## or with an IP e.g. "127.0.0.1:8883" - + enabled = true + acceptors = 16 + enable_authn = true + max_connections = infinity + mountpoint = "" + proxy_protocol = false + proxy_protocol_timeout = 3s + tcp_options { + active_n = 100 + backlog = 1024 + buffer = 4KB + high_watermark = 1MB + keepalive = none + nodelay = true + reuseaddr = true + send_timeout = 15s + send_timeout_close = true + } ssl_options { ## Trusted PEM format CA certificates bundle file cacertfile = "data/certs/cacert.pem" @@ -27,7 +44,7 @@ listeners.ssl.sslname { ## Enable or disable peer verification verify = verify_none ## use verify_peer to enable - ## if `verify' is ebabled, whit true, the connection fails if the client does not have a certificate to send + ## if `verify' is enabled, whit true, the connection fails if the client does not have a certificate to send fail_if_no_peer_cert = false ## Enable TLS session reuse @@ -61,5 +78,13 @@ listeners.ssl.sslname { ## Maximum time duration allowed for the handshake to complete handshake_timeout = 15s + + ocsp { + enable_ocsp_stapling = false + responder_url = "http://ocsp.example.com" + issuer_pem = true + refresh_http_timeout = 15s + refresh_interval = 5m + } } } diff --git a/examples/listeners.ws.conf.example b/examples/listeners.ws.conf.example index ad9ddbf8a..60523ac7a 100644 --- a/examples/listeners.ws.conf.example +++ b/examples/listeners.ws.conf.example @@ -13,6 +13,23 @@ listeners.ws.wsname { ## Port or Address to listen on, 0 means disable bind = "0.0.0.0:8083" # or just a port number, e.g. 8083 + enabled = true + enable_authn = true + max_connections = infinity + proxy_protocol = false + proxy_protocol_timeout = 3s + mountpoint = "" + tcp_options { + active_n = 100 + backlog = 1024 + buffer = 4KB + high_watermark = 1MB + keepalive = none + nodelay = true + reuseaddr = true + send_timeout = 15s + send_timeout_close = true + } websocket { ## WebSocket's MQTT protocol path diff --git a/examples/listeners.wss.conf.example b/examples/listeners.wss.conf.example index a5801b160..799d082d7 100644 --- a/examples/listeners.wss.conf.example +++ b/examples/listeners.wss.conf.example @@ -13,6 +13,45 @@ listeners.wss.wssname { ## Port or Address to listen on, 0 means disable bind = 8084 ## or with an IP, e.g. "127.0.0.1:8084" + enabled = true + enable_authn = true + max_connections = infinity + proxy_protocol = false + proxy_protocol_timeout = 3s + mountpoint = "" + tcp_options { + active_n = 100 + backlog = 1024 + buffer = 4KB + high_watermark = 1MB + keepalive = none + nodelay = true + reuseaddr = true + send_timeout = 15s + send_timeout_close = true + } + websocket { + allow_origin_absence = true + check_origin_enable = false + check_origins = "http://localhost:18083, http://127.0.0.1:18083" + compress = false + deflate_opts { + client_context_takeover = "takeover" + client_max_window_bits = 15 + mem_level = 8 + server_context_takeover = "takeover" + server_max_window_bits = 15 + strategy = "default" + } + fail_if_no_subprotocol = true + idle_timeout = "7200s" + max_frame_size = "infinity" + mqtt_path = "/mqtt" + mqtt_piggyback = "multiple" + proxy_address_header = "x-forwarded-for" + proxy_port_header = "x-forwarded-port" + supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5" + } ssl_options { ## Trusted PEM format CA certificates bundle file @@ -27,7 +66,7 @@ listeners.wss.wssname { ## Enable or disable peer verification verify = verify_none ## use verify_peer to enable - ## if `verify' is ebabled, whit true, the connection fails if the client does not have a certificate to send + ## if `verify' is enabled, whit true, the connection fails if the client does not have a certificate to send fail_if_no_peer_cert = false ## Enable TLS session reuse diff --git a/examples/log.file.conf.example b/examples/log.file.conf.example index e4e3769fc..deb9b16b9 100644 --- a/examples/log.file.conf.example +++ b/examples/log.file.conf.example @@ -34,5 +34,5 @@ log.file { ## Type: ## - infinity :: the log file will grow indefinitely ## - ByteSize :: the log file will be rotated once it reaches this value in bytes - rotation_size = "50MB" + rotation_size = 50MB } diff --git a/examples/node.conf.example b/examples/node.conf.example index e7d6979ed..65c08b337 100644 --- a/examples/node.conf.example +++ b/examples/node.conf.example @@ -39,5 +39,5 @@ node { data_dir = "var/emqx/data" ## Type: Periodic garbage collection interval - global_gc_interval = "15m" + global_gc_interval = 15m } diff --git a/examples/overload_protection.conf.example b/examples/overload_protection.conf.example deleted file mode 100644 index 36aba702c..000000000 --- a/examples/overload_protection.conf.example +++ /dev/null @@ -1,25 +0,0 @@ -##-------------------------------------------------------------------- -## Overload Protection -## -## Monitoring the load of the system and temporarily disable some features when the load is high -##-------------------------------------------------------------------- -## Note: This is an example of how to configure this feature -## you should copy and paste the below data into the emqx.conf for working - -## Note: Do not modify this unless you know what this is for -overload_protection { - ## set true to enable this - enable = false - - ## Maximum duration of delay for background task execution during high load conditions - backoff_delay = 1 - - ## When at high load, skip forceful GC - backoff_gc = false - - ## When at high load, skip process hibernation - backoff_hibernation = true - - ## When at high load, close new incoming connections - backoff_new_conn = true -} diff --git a/examples/slow_subs.conf.example b/examples/slow_subs.conf.example deleted file mode 100644 index 8409cf466..000000000 --- a/examples/slow_subs.conf.example +++ /dev/null @@ -1,28 +0,0 @@ -##-------------------------------------------------------------------- -## Slow Subscribers Statistics -## -## Count subscribers with topics whose transfer time exceeds the threshold -##-------------------------------------------------------------------- -## Note: This is an example of how to configure this feature -## you should copy and paste the below data into the emqx.conf for working - -slow_subs { - ## Stats Threshold - threshold = 500ms - - ## Expire time of the record which in Top-K record - expire_interval = 300ms - - ## Maximum number of Top-K record - top_k_num = 10 - - ## Stats Type - ## Value: - ## - whole: from the time the message arrives at EMQX until the message transmission completes - ## - internal: from when the message arrives at EMQX until when EMQX starts delivering the message - ## - response: from the time EMQX starts delivering the message until the message transmission completes - stats_type = whole - - ## use true to enable this - enable = false -} diff --git a/examples/sysmon.os.conf.example b/examples/sysmon.os.conf.example index 9883890dc..95e7aa1ec 100644 --- a/examples/sysmon.os.conf.example +++ b/examples/sysmon.os.conf.example @@ -8,23 +8,23 @@ sysmon.os { ## Time interval for the periodic CPU check - cpu_check_interval = "60s" + cpu_check_interval = 60s ## For how much system cpu can be used before the corresponding alarm is raised - cpu_high_watermark = "80%" + cpu_high_watermark = 80% ## For how much system cpu can be used before the corresponding alarm is cleared - cpu_low_watermark = "60%" + cpu_low_watermark = 60% ## Time interval for the periodic memory check ## Type: ## - disabled :: Never check ## - Time Duration :: The time period - mem_check_interval = "60s" + mem_check_interval = 60s ## For how much system memory can be allocated before the corresponding alarm is raised - sysmem_high_watermark = "70%" + sysmem_high_watermark = 70% ## For how much system memory can be allocated by one Erlang process before the corresponding alarm is raised - procmem_high_watermark = "5%" + procmem_high_watermark = 5% } diff --git a/examples/sysmon.vm.conf.example b/examples/sysmon.vm.conf.example index 75eb2fef6..d68141cea 100644 --- a/examples/sysmon.vm.conf.example +++ b/examples/sysmon.vm.conf.example @@ -11,10 +11,10 @@ sysmon.vm { process_check_interval = 30s ## For how many processes can simultaneously exist at the local node before the corresponding alarm is raised - process_high_watermark = "80%" + process_high_watermark = 80% ## For how many processes can simultaneously exist at the local node before the corresponding alarm is cleared - process_low_watermark = "60%" + process_low_watermark = 60% ## Generated an alarm when an Erlang process spends a long time to perform garbage collection ## Type: @@ -32,7 +32,7 @@ sysmon.vm { ## Type: ## - disabled :: Never alarm ## - ByteSize :: The maximum heap size for generating an alarm - large_heap = 32M + large_heap = 32MB ## Generating an alarm when the RPC connection is overloaded busy_dist_port = true