Просмотр исходного кода

chore: more detail for examples

zhongwencool 2 лет назад
Родитель
Сommit
53fdda8eef

+ 0 - 30
examples/auto_subscribe.conf.example

@@ -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}/+"}
-]

+ 27 - 2
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
+        }
     }
 }

+ 17 - 0
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

+ 40 - 1
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

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 0 - 25
examples/overload_protection.conf.example

@@ -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
-}

+ 0 - 28
examples/slow_subs.conf.example

@@ -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
-}

+ 6 - 6
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%
 }

+ 3 - 3
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