chore: add examples of how to configure
This commit is contained in:
parent
53ab85b165
commit
c4222557ba
|
@ -6,7 +6,7 @@ deps
|
|||
*.o
|
||||
*.beam
|
||||
*.plt
|
||||
*.example
|
||||
#*.example
|
||||
erl_crash.dump
|
||||
ebin
|
||||
!ebin/.placeholder
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Delayed publish
|
||||
##
|
||||
## Configuring the delayed publish feature
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
delayed {
|
||||
enable = true ## false for disabled
|
||||
|
||||
## Maximum number of delayed messages
|
||||
## Default: 0 (0 is no limit)
|
||||
max_delayed_messages = 0
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
# Examples
|
||||
|
||||
Here are examples of how to configure features In EMQX, most of them can be used directly by copy-paste content into the `emqx.conf` file, others may need to be slightly modified to use, for example, you should change the listener port or HTTP URL to what you actually used.
|
||||
|
||||
Although we have tried to show every configurable field in the example,
|
||||
you do not need to care about each one, since most of them already have default values and can be omitted in the configuration file.
|
||||
|
||||
If you are confused about some fields, please refer to our documents, here are just some simple configuration examples with necessary descriptions.
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
The EMQX documentation is available at [www.emqx.io/docs/en/latest/](https://www.emqx.io/docs/en/latest/).
|
||||
|
||||
The EMQX Enterprise documentation is available at [docs.emqx.com/en/](https://docs.emqx.com/en/).
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Alarm
|
||||
##
|
||||
## Configuring how to handle the alarms generated from sysmon.*.conf.example
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
alarm {
|
||||
## The actions triggered when the alarm is activated
|
||||
## Type: Array of the below enum
|
||||
## - log :: write the alarm to log
|
||||
## - publish :: publish the alarm as an MQTT message to the system topics
|
||||
actions = [log]
|
||||
|
||||
## Maximum total number of deactivated alarms to keep as history
|
||||
## Type: Range from 1 to 3000
|
||||
size_limit = 1000
|
||||
|
||||
## Retention time of deactivated alarms
|
||||
validity_period = 24h
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
##--------------------------------------------------------------------
|
||||
## 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}/+"}
|
||||
]
|
|
@ -0,0 +1,30 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Broker
|
||||
##
|
||||
## Message broker options
|
||||
##--------------------------------------------------------------------
|
||||
## 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: If you and finding how to configure EMQX itself, have a look at the node.conf.example
|
||||
|
||||
broker {
|
||||
## Session locking strategy in a cluster
|
||||
## Type:
|
||||
## - local :: only lock the session on the current node
|
||||
## - leader :: select only one remote node to lock the session
|
||||
## - quorum :: select some nodes to lock the session
|
||||
## - all :: lock the session on all the nodes in the cluster
|
||||
session_locking_strategy = quorum
|
||||
|
||||
## Dispatch strategy for shared subscription
|
||||
## Type:
|
||||
## - random :: dispatch the message to a random selected subscriber
|
||||
## - round_robin :: select the subscribers in a round-robin manner
|
||||
## - round_robin_per_group :: select the subscribers in round-robin fashion within each shared subscriber group
|
||||
## - local :: select random local subscriber otherwise select random cluster-wide
|
||||
## - sticky :: always use the last selected subscriber to dispatch, until the subscriber disconnects.
|
||||
## - hash_clientid :: select the subscribers by hashing the `clientIds`
|
||||
## - hash_topic :: select the subscribers by hashing the source topic"""
|
||||
shared_subscription_strategy = round_robin
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Cluster in service discovery via DNS SRV records mode
|
||||
##
|
||||
## Configs to instruct how individual nodes can discover each other
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
cluster {
|
||||
## Human-friendly name of the EMQX cluster.
|
||||
name = emqxcl
|
||||
|
||||
## Service discovery method for the cluster nodes
|
||||
discovery_strategy = dns
|
||||
|
||||
## List of core nodes that the replicant will connect to
|
||||
core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
|
||||
## Remove disconnected nodes from the cluster after this interval
|
||||
autoclean = 5m
|
||||
|
||||
## If true, the node will try to heal network partitions automatically
|
||||
autoheal = true
|
||||
|
||||
dns {
|
||||
## The domain name from which to discover peer EMQX nodes' IP addresses
|
||||
name = localhost
|
||||
|
||||
## DNS record type
|
||||
## Type: enum: a | srv
|
||||
record_type = a
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Cluster in service discovery using 'etcd' service mode
|
||||
##
|
||||
## Configs to instruct how individual nodes can discover each other
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
cluster {
|
||||
## Human-friendly name of the EMQX cluster.
|
||||
name = emqxcl
|
||||
|
||||
## Service discovery method for the cluster nodes
|
||||
discovery_strategy = etcd
|
||||
|
||||
## List of core nodes that the replicant will connect to
|
||||
core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
|
||||
## Remove disconnected nodes from the cluster after this interval
|
||||
autoclean = 5m
|
||||
|
||||
## If true, the node will try to heal network partitions automatically
|
||||
autoheal = true
|
||||
|
||||
etcd {
|
||||
## List of endpoint URLs of the etcd cluster
|
||||
server = "http://ur1,http://ur2"
|
||||
|
||||
## Key prefix used for EMQX service discovery
|
||||
prefix = emqxcl
|
||||
|
||||
## Expiration time of the etcd key associated with the node.
|
||||
node_ttl = 1m
|
||||
|
||||
ssl_options {
|
||||
## Trusted PEM format CA certificates bundle file
|
||||
cacertfile = "data/certs/cacert.pem"
|
||||
|
||||
## PEM format certificates chain file
|
||||
certfile = "data/certs/cert.pem"
|
||||
|
||||
## PEM format private key file
|
||||
keyfile = "data/certs/key.pem"
|
||||
|
||||
## 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
|
||||
fail_if_no_peer_cert = false
|
||||
|
||||
## Enable TLS session reuse
|
||||
reuse_sessions = true
|
||||
|
||||
## Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path
|
||||
depth = 10
|
||||
|
||||
## Which versions are to be supported
|
||||
versions = [tlsv1.3, tlsv1.2]
|
||||
|
||||
## TLS cipher suite names
|
||||
## Note: By default, all available suites are supported, you do not need to set this
|
||||
ciphers = ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"]
|
||||
|
||||
## Allows a client and a server to renegotiate the parameters of the SSL connection on the fly
|
||||
secure_renegotiate = true
|
||||
|
||||
## Log level for SSL communication
|
||||
## Type: emergency | alert | critical | error | warning | notice | info | debug | none | all
|
||||
log_level = notice
|
||||
|
||||
## Hibernate the SSL process after idling for amount of time reducing its memory footprint
|
||||
hibernate_after = 5s
|
||||
|
||||
## Forces the cipher to be set based on the server-specified order instead of the client-specified order
|
||||
honor_cipher_order = true
|
||||
|
||||
## Setting this to false to disable client-initiated renegotiation
|
||||
client_renegotiation = true
|
||||
|
||||
## Maximum time duration allowed for the handshake to complete
|
||||
handshake_timeout = 15s
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Cluster in service discovery using 'etcd' service mode
|
||||
##
|
||||
## Configs to instruct how individual nodes can discover each other
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
cluster {
|
||||
## Human-friendly name of the EMQX cluster.
|
||||
name = emqxcl
|
||||
|
||||
## Service discovery method for the cluster nodes
|
||||
discovery_strategy = etcd
|
||||
|
||||
## List of core nodes that the replicant will connect to
|
||||
core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
|
||||
## Remove disconnected nodes from the cluster after this interval
|
||||
autoclean = 5m
|
||||
|
||||
## If true, the node will try to heal network partitions automatically
|
||||
autoheal = true
|
||||
|
||||
etcd {
|
||||
## List of endpoint URLs of the etcd cluster
|
||||
## Type: Comma Separated String
|
||||
server = "http://ur1,http://ur2"
|
||||
|
||||
## Key prefix used for EMQX service discovery
|
||||
prefix = emqxcl
|
||||
|
||||
## Expiration time of the etcd key associated with the node
|
||||
node_ttl = 1m
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Cluster in service discovery via Kubernetes API server mode
|
||||
##
|
||||
## Configs to instruct how individual nodes can discover each other
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
cluster {
|
||||
## Human-friendly name of the EMQX cluster.
|
||||
name = emqxcl
|
||||
|
||||
## Service discovery method for the cluster nodes
|
||||
discovery_strategy = k8s
|
||||
|
||||
## List of core nodes that the replicant will connect to
|
||||
core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
|
||||
## Remove disconnected nodes from the cluster after this interval
|
||||
autoclean = 5m
|
||||
|
||||
## If true, the node will try to heal network partitions automatically
|
||||
autoheal = true
|
||||
|
||||
k8s {
|
||||
## Kubernetes API endpoint URL
|
||||
apiserver = "http://10.110.111.204:8080"
|
||||
|
||||
## EMQX broker service name
|
||||
service_name = emqx
|
||||
|
||||
## Address type used for connecting to the discovered nodes
|
||||
## Type: ip | dns | hostname
|
||||
address_type = ip
|
||||
|
||||
## Kubernetes namespace
|
||||
namespace = default
|
||||
|
||||
## Node name suffix
|
||||
suffix = "pod.local"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Cluster in service discovery via manual join mode
|
||||
##
|
||||
## Configs to instruct how individual nodes can discover each other
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
cluster {
|
||||
## Human-friendly name of the EMQX cluster.
|
||||
name = emqxcl
|
||||
|
||||
## Service discovery method for the cluster nodes
|
||||
discovery_strategy = manual
|
||||
|
||||
## List of core nodes that the replicant will connect to
|
||||
core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
|
||||
## Remove disconnected nodes from the cluster after this interval
|
||||
autoclean = 5m
|
||||
|
||||
## If true, the node will try to heal network partitions automatically
|
||||
autoheal = true
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Cluster in service discovery via static nodes mode
|
||||
##
|
||||
## Configs to instruct how individual nodes can discover each other
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
cluster {
|
||||
## Human-friendly name of the EMQX cluster.
|
||||
name = emqxcl
|
||||
|
||||
## Service discovery method for the cluster nodes
|
||||
discovery_strategy = static
|
||||
|
||||
## List of core nodes that the replicant will connect to
|
||||
core_nodes = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
|
||||
## Remove disconnected nodes from the cluster after this interval
|
||||
autoclean = 5m
|
||||
|
||||
## If true, the node will try to heal network partitions automatically
|
||||
autoheal = true
|
||||
|
||||
## List EMQX node names in the static cluster
|
||||
static.seeds = ['emqx1@192.168.0.1', 'emqx2@192.168.0.2']
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Connection Congestion
|
||||
##
|
||||
## Generating alarm when MQTT connection congested
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
conn_congestion {
|
||||
## Enable or disable connection congestion alarm
|
||||
enable_alarm = true
|
||||
|
||||
## Minimal time before clearing the alarm
|
||||
min_alarm_sustain_duration = 1m
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Dashboard with HTTP Listener
|
||||
##
|
||||
## Configuration for EMQX dashboard
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
dashboard {
|
||||
## JWT token expiration time
|
||||
token_expired_time = 60m
|
||||
|
||||
## Support Cross-Origin Resource Sharing (CORS)
|
||||
cors = false
|
||||
|
||||
listeners.http {
|
||||
## Whether to enable the listener
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
bind = "0.0.0.0:18083" ## or just a port number, e.g. 18083
|
||||
|
||||
## Socket acceptor pool size for TCP protocols
|
||||
num_acceptors = 8
|
||||
|
||||
## Maximum number of simultaneous connections
|
||||
max_connections = 512
|
||||
|
||||
## Defines the maximum length that the queue of pending connections can grow to
|
||||
backlog = 1024
|
||||
|
||||
## Send timeout for the socket
|
||||
send_timeout = 10s
|
||||
|
||||
## Enable IPv6 support, default is false, which means IPv4 only
|
||||
inet6 = false
|
||||
|
||||
## Disable IPv4-to-IPv6 mapping for the listener
|
||||
ipv6_v6only = false
|
||||
|
||||
## Enable support for `HAProxy` header
|
||||
proxy_header = false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Dashboard with HTTPS Listener
|
||||
##
|
||||
## Configuration for EMQX dashboard
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
dashboard {
|
||||
## JWT token expiration time
|
||||
token_expired_time = 60m
|
||||
|
||||
## Support Cross-Origin Resource Sharing (CORS)
|
||||
cors = false
|
||||
|
||||
listeners.https {
|
||||
## Whether to enable the listener
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
bind = "0.0.0.0:18084" ## or just a port number, e.g. 18084
|
||||
|
||||
## Socket acceptor pool size for TCP protocols
|
||||
num_acceptors = 8
|
||||
|
||||
## Maximum number of simultaneous connections
|
||||
max_connections = 512
|
||||
|
||||
## Defines the maximum length that the queue of pending connections can grow to
|
||||
backlog = 1024
|
||||
|
||||
## Send timeout for the socket
|
||||
send_timeout = 10s
|
||||
|
||||
## Enable IPv6 support, default is false, which means IPv4 only
|
||||
inet6 = false
|
||||
|
||||
## Disable IPv4-to-IPv6 mapping for the listener
|
||||
ipv6_v6only = false
|
||||
|
||||
## Enable support for `HAProxy` header
|
||||
proxy_header = false
|
||||
|
||||
## Trusted PEM format CA certificates bundle file
|
||||
cacertfile = "data/certs/cacert.pem"
|
||||
|
||||
## PEM format certificates chain file
|
||||
certfile = "data/certs/cert.pem"
|
||||
|
||||
## PEM format private key file
|
||||
keyfile = "data/certs/key.pem"
|
||||
|
||||
## 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
|
||||
fail_if_no_peer_cert = false
|
||||
|
||||
## Enable TLS session reuse
|
||||
reuse_sessions = true
|
||||
|
||||
## Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path
|
||||
depth = 10
|
||||
|
||||
## Which versions are to be supported
|
||||
versions = [tlsv1.3, tlsv1.2]
|
||||
|
||||
## TLS cipher suite names
|
||||
## Note: By default, all available suites are supported, you do not need to set this
|
||||
ciphers = ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"]
|
||||
|
||||
## Allows a client and a server to renegotiate the parameters of the SSL connection on the fly
|
||||
secure_renegotiate = true
|
||||
|
||||
## Log level for SSL communication
|
||||
## Type: emergency | alert | critical | error | warning | notice | info | debug | none | all
|
||||
log_level = notice
|
||||
|
||||
## Hibernate the SSL process after idling for amount of time reducing its memory footprint
|
||||
hibernate_after = 5s
|
||||
|
||||
## Forces the cipher to be set based on the server-specified order instead of the client-specified order
|
||||
honor_cipher_order = true
|
||||
|
||||
## Setting this to false to disable client-initiated renegotiation
|
||||
client_renegotiation = true
|
||||
|
||||
## Maximum time duration allowed for the handshake to complete
|
||||
handshake_timeout = 15s
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
##--------------------------------------------------------------------
|
||||
## gRPC Hook Extension
|
||||
##
|
||||
## Allows users to process EMQX Hooks using other programming languages
|
||||
##--------------------------------------------------------------------
|
||||
|
||||
exhook.servers = [
|
||||
{
|
||||
## Name of the exhook server
|
||||
name = "server_1"
|
||||
|
||||
## Feature switch
|
||||
enable = false
|
||||
|
||||
## URL of gRPC server
|
||||
url = "http://127.0.0.1:9090"
|
||||
|
||||
## The timeout of request gRPC server
|
||||
request_timeout = 5s
|
||||
|
||||
## This value will be returned when the request to the gRPC server fails for any reason
|
||||
## Type:
|
||||
## - deny :: stop to execute this hook.
|
||||
## - ignore :: continue to execute this hook
|
||||
failed_action = deny
|
||||
|
||||
## Interval of automatically reconnecting the gRPC server when the connection is broken
|
||||
## Type:
|
||||
## - false :: Never reconnect
|
||||
## - Time Duration, e.g.15s, 10m, 1h :: Reconnecting Interval
|
||||
auto_reconnect = 60s
|
||||
|
||||
## The process pool size for gRPC client
|
||||
pool_size = 8
|
||||
|
||||
## Connection socket options
|
||||
socket_options {
|
||||
## Whether periodic transmission on a connected socket when no other data is exchanged
|
||||
keepalive = true
|
||||
|
||||
## TCP_NODELAY switch
|
||||
nodelay = true
|
||||
|
||||
## The minimum size of receive buffer to use for the socket
|
||||
recbuf = "64KB"
|
||||
|
||||
## The minimum size of send buffer to use for the socket
|
||||
sndbuf = "16KB"
|
||||
}
|
||||
},
|
||||
{name = "server_2", url = "http://127.0.0.1:9091"}
|
||||
]
|
|
@ -0,0 +1,50 @@
|
|||
##--------------------------------------------------------------------
|
||||
## File Transfer
|
||||
##
|
||||
## Enables the File Transfer over MQTT feature
|
||||
##--------------------------------------------------------------------
|
||||
## 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: This configuration only works for the EMQX Enterprise version
|
||||
|
||||
file_transfer {
|
||||
## Enable the File Transfer feature
|
||||
enable = true
|
||||
|
||||
## Storage backend settings
|
||||
storage {
|
||||
## Local file system backend setting
|
||||
## Currently, it's the only available storage backend.
|
||||
local {
|
||||
## Enable the backend
|
||||
enable = true
|
||||
|
||||
## Segments and temporary files storage settings
|
||||
segments {
|
||||
## Directory where these files are stored
|
||||
root = "/var/lib/emqx/transfers/segments"
|
||||
|
||||
## Garbage collection settings
|
||||
gc {
|
||||
## How often to run GC
|
||||
interval = 1h
|
||||
|
||||
## Maximum time to keep parts of incomplete transfers for
|
||||
maximum_segments_ttl = 24h
|
||||
}
|
||||
}
|
||||
|
||||
## Local filesystem exporter
|
||||
exporter.local {
|
||||
|
||||
## Enable the backend
|
||||
## Note: Only one backend may be enabled at a time
|
||||
enable = true
|
||||
|
||||
## Directory in the local file system where to store transferred files
|
||||
root = "/var/lib/emqx/transfers/exports"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
##--------------------------------------------------------------------
|
||||
## File Transfer
|
||||
##
|
||||
## Enables the File Transfer over MQTT feature
|
||||
##--------------------------------------------------------------------
|
||||
## 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: This configuration only works for the EMQX Enterprise version
|
||||
|
||||
file_transfer {
|
||||
## Enable the File Transfer feature
|
||||
enable = true
|
||||
|
||||
## Storage backend settings
|
||||
storage {
|
||||
## Local file system backend setting
|
||||
## Currently, it's the only available storage backend.
|
||||
local {
|
||||
## Enable the backend
|
||||
enable = true
|
||||
|
||||
## Segments and temporary files storage settings
|
||||
segments {
|
||||
## Directory where these files are stored
|
||||
root = "/var/lib/emqx/transfers/segments"
|
||||
|
||||
## Garbage collection settings
|
||||
gc {
|
||||
## How often to run GC
|
||||
interval = 1h
|
||||
|
||||
## Maximum time to keep parts of incomplete transfers for
|
||||
maximum_segments_ttl = 24h
|
||||
}
|
||||
}
|
||||
|
||||
## S3-compatible object storage exporter
|
||||
exporter.s3 {
|
||||
|
||||
## Disable the backend
|
||||
## Note: Only one backend may be enabled at a time.
|
||||
enable = true
|
||||
|
||||
## Endpoint of S3 API of the object storage service of your choice
|
||||
host = "s3.us-east-1.amazonaws.com"
|
||||
port = 443
|
||||
|
||||
## Credentials to use to authorize with the S3 API
|
||||
access_key_id = "AKIA27EZDDM9XLINWXFE"
|
||||
secret_access_key = "..."
|
||||
|
||||
## Which bucket to store transferred files in?
|
||||
bucket = "my-bucket"
|
||||
|
||||
## TTL of file download URLs exposed through File Transfer API
|
||||
url_expire_time = 1h
|
||||
|
||||
## Enable the HTTPS
|
||||
transport_options.ssl.enable = true
|
||||
|
||||
## Timeout for connection attempts
|
||||
connect_timeout = 15s
|
||||
|
||||
## Attempt to talk through IPv6 first
|
||||
ipv6_probe = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Flapping Detect
|
||||
##
|
||||
## Ban the client when the times of connections exceed the limit in the time window
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
flapping_detect {
|
||||
## Feature switch
|
||||
enable = false
|
||||
|
||||
## Time window for flapping detection
|
||||
window_time = 1m
|
||||
|
||||
## Maximum number of connects allowed for a MQTT Client in window_time
|
||||
max_count = 15
|
||||
|
||||
## How long the flapping clientid will be banned
|
||||
ban_time = 5m
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Force garbage collection
|
||||
##
|
||||
## Force garbage collection in MQTT connection process after they process certain number of messages or bytes of data
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
force_gc {
|
||||
## set to false to disable this
|
||||
enable = true
|
||||
|
||||
## GC the process after this many received messages
|
||||
count = 16000
|
||||
|
||||
## GC the process after specified number of bytes have passed through
|
||||
bytes = 16MB
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Force Shutdown
|
||||
##
|
||||
## Forced closing of the overloaded session
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
force_shutdown {
|
||||
## false to disable this
|
||||
enable = true
|
||||
|
||||
## Maximum mailbox size for each Erlang process
|
||||
## Note: Do not modify this unless you know what this is for
|
||||
max_mailbox_size = 1000
|
||||
|
||||
## Maximum heap size for each session process
|
||||
max_heap_size = 32MB
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
##--------------------------------------------------------------------
|
||||
## License
|
||||
##
|
||||
## Defines the EMQX Enterprise license
|
||||
##--------------------------------------------------------------------
|
||||
## 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: This configuration only works for the EMQX Enterprise version
|
||||
|
||||
license {
|
||||
## License Key
|
||||
key = "MjIwMTExCjAKMTAKRXZhbHVhdGlvbgpjb250YWN0QGVtcXguaW8KZGVmYXVsdAoyMDIzMDEwOQoxODI1CjEwMAo=.MEUCIG62t8W15g05f1cKx3tA3YgJoR0dmyHOPCdbUxBGxgKKAiEAhHKh8dUwhU+OxNEaOn8mgRDtiT3R8RZooqy6dEsOmDI="
|
||||
## Low watermark limit below which license connection quota usage alarms are deactivated
|
||||
connection_low_watermark = "75%"
|
||||
|
||||
## High watermark limit above which license connection quota usage alarms are activated
|
||||
connection_high_watermark = "80%"
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
##--------------------------------------------------------------------
|
||||
## QUIC Listener
|
||||
##
|
||||
## Add a QUIC Listener
|
||||
##--------------------------------------------------------------------
|
||||
## 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: Modifying the 'quicname' to what you need
|
||||
listeners.quic.quicname {
|
||||
## Whether to enable the listener
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
bind = 14567 ## or with an IP, e.g. "127.0.0.1:14567"
|
||||
|
||||
## When publishing or subscribing, prefix all topics with a mountpoint string
|
||||
mountpoint = "${clientid}/msg"
|
||||
|
||||
## Client authentication
|
||||
## Type:
|
||||
## - true :: enable
|
||||
## - false :: disable
|
||||
## - quick_deny_anonymous :: denied immediately without if username is not provided
|
||||
enable_authn = true
|
||||
|
||||
## Socket acceptor pool size for TCP protocols
|
||||
acceptors = 16
|
||||
|
||||
## Maximum number of simultaneous connections
|
||||
## Type: infinity | Integer
|
||||
max_connections = infinity
|
||||
|
||||
## Trusted PEM format CA certificates bundle file
|
||||
cacertfile = "data/certs/cacert.pem"
|
||||
|
||||
## PEM format certificates chain file
|
||||
certfile = "data/certs/cert.pem"
|
||||
|
||||
## PEM format private key file
|
||||
keyfile = "data/certs/key.pem"
|
||||
|
||||
## Enable or disable peer verification
|
||||
verify = verify_none ## to verify_peer to enable
|
||||
|
||||
## TLS cipher suite names
|
||||
ciphers = ["TLS_AES_256_GCM_SHA384", "TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256"]
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
##--------------------------------------------------------------------
|
||||
## SSL Listener
|
||||
##
|
||||
## Add a SSL Listener
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
## The SSL listener also supports all the fields listed in listeners.tcp.conf.example
|
||||
## only the SSL-specific fields are shown here
|
||||
|
||||
## Note: Modifying the 'sslname' to what you need
|
||||
listeners.ssl.sslname {
|
||||
## Whether to enable the listener
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
bind = 8883 ## or with an IP e.g. "127.0.0.1:8883"
|
||||
|
||||
## Trusted PEM format CA certificates bundle file
|
||||
cacertfile = "data/certs/cacert.pem"
|
||||
|
||||
## PEM format certificates chain file
|
||||
certfile = "data/certs/cert.pem"
|
||||
|
||||
## PEM format private key file
|
||||
keyfile = "data/certs/key.pem"
|
||||
|
||||
## 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
|
||||
fail_if_no_peer_cert = false
|
||||
|
||||
## Enable TLS session reuse
|
||||
reuse_sessions = true
|
||||
|
||||
## Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path
|
||||
depth = 10
|
||||
|
||||
## Which versions are to be supported
|
||||
versions = [tlsv1.3, tlsv1.2]
|
||||
|
||||
## TLS cipher suite names
|
||||
## Note: By default, all available suites are supported, you do not need to set this
|
||||
ciphers = ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"]
|
||||
|
||||
## Allows a client and a server to renegotiate the parameters of the SSL connection on the fly
|
||||
secure_renegotiate = true
|
||||
|
||||
## Log level for SSL communication
|
||||
## Type: emergency | alert | critical | error | warning | notice | info | debug | none | all
|
||||
log_level = notice
|
||||
|
||||
## Hibernate the SSL process after idling for amount of time reducing its memory footprint
|
||||
hibernate_after = 5s
|
||||
|
||||
## Forces the cipher to be set based on the server-specified order instead of the client-specified order
|
||||
honor_cipher_order = true
|
||||
|
||||
## Setting this to false to disable client-initiated renegotiation
|
||||
client_renegotiation = true
|
||||
|
||||
## Maximum time duration allowed for the handshake to complete
|
||||
handshake_timeout = 15s
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
##--------------------------------------------------------------------
|
||||
## TCP Listener
|
||||
##
|
||||
## Add a TCP Listener
|
||||
##--------------------------------------------------------------------
|
||||
## 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: Modifying the 'tcpname' to what you need
|
||||
listeners.tcp.tcpname {
|
||||
## false to disable this
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
bind = 1883 ## or with an IP e.g. "127.0.0.1:1883"
|
||||
|
||||
## Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx
|
||||
proxy_protocol = false
|
||||
|
||||
## Timeout for proxy protocol
|
||||
proxy_protocol_timeout = 8
|
||||
|
||||
## When publishing or subscribing, prefix all topics with a mountpoint string
|
||||
mountpoint = "mqtt" ## Do not set this unless you know what is it for
|
||||
|
||||
## Client authentication
|
||||
## Type:
|
||||
## - true :: enable
|
||||
## - false :: disable
|
||||
## - quick_deny_anonymous :: denied immediately without if username is not provided
|
||||
enable_authn = true
|
||||
|
||||
## The access control rules for this listener
|
||||
## Type: See: https://github.com/emqtt/esockd#allowdeny
|
||||
access_rules = ["allow all"]
|
||||
|
||||
## Socket acceptor pool size for TCP protocols
|
||||
acceptors = 16
|
||||
|
||||
## Maximum number of simultaneous connections
|
||||
## Type: infinity | Integer
|
||||
max_connections = infinity
|
||||
|
||||
## TCP backlog defines the maximum length that the queue of pending connections can grow to
|
||||
backlog = 1024
|
||||
|
||||
## The TCP send timeout for the connections
|
||||
send_timeout = 15s
|
||||
|
||||
## Timeout for proxy protocol
|
||||
send_timeout_close = true
|
||||
|
||||
## The TCP receive buffer (OS kernel) for the connections
|
||||
recbuf = 2KB
|
||||
|
||||
## The TCP send buffer (OS kernel) for the connections
|
||||
sndbuf = 4KB
|
||||
|
||||
## The size of the user-space buffer used by the driver
|
||||
buffer = 4KB
|
||||
|
||||
## The socket is set to a busy state when the amount of data queued internally by the VM socket implementation reaches this limit
|
||||
high_watermark = 1MB
|
||||
|
||||
## The TCP_NODELAY flag for the connections
|
||||
nodelay = true
|
||||
|
||||
## The SO_REUSEADDR flag for the connections
|
||||
reuseaddr = true
|
||||
|
||||
## Enable TCP keepalive for MQTT connections over TCP or SSL
|
||||
## Type: three comma separated numbers in the format of 'Idle,Interval,Probes'
|
||||
## - Idle: The number of seconds a connection needs to be idle before the server begins to send out keep-alive probes (Linux default 7200).
|
||||
## - Interval: The number of seconds between TCP keep-alive probes (Linux default 75).
|
||||
## - Probes: The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end (Linux default 9).
|
||||
## For example "240,30,5" means: EMQX should start sending TCP keepalive probes after the connection is in idle for 240 seconds, and the probes are sent every 30 seconds until a response is received from the MQTT client, if it misses 5 consecutive responses, EMQX should close the connection
|
||||
keepalive = "none"
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
##--------------------------------------------------------------------
|
||||
## WebSocket Listener
|
||||
##
|
||||
## Add a WebSocket Listener
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
## The WebSocket listener supports all the fields listed in listeners.tcp.conf.example
|
||||
## only the WebSocket-specific fields are shown here
|
||||
|
||||
## Note: Modifying the 'wsname' to what you need
|
||||
listeners.ws.wsname {
|
||||
## for to disable this
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
bind = "0.0.0.0:8083" # or just a port number, e.g. 8083
|
||||
|
||||
## WebSocket's MQTT protocol path
|
||||
## Type: String
|
||||
## For Example:
|
||||
## with the default value, the address of EMQX Broker's WebSocket is: ws://8083/mqtt
|
||||
mqtt_path = "/mqtt"
|
||||
|
||||
## Whether a WebSocket message is allowed to contain multiple MQTT packets
|
||||
## Type: single | multiple
|
||||
mqtt_piggyback = multiple
|
||||
|
||||
## If true, compress WebSocket messages using zlib
|
||||
compress = false
|
||||
|
||||
## Close transport-layer connections from the clients that have not sent MQTT CONNECT message within this interval
|
||||
idle_timeout = 7200s
|
||||
|
||||
## The maximum length of a single MQTT packet
|
||||
## Type: infinity | Integer
|
||||
max_frame_size = infinity
|
||||
|
||||
## If true, the server will return an error when the client does not carry the Sec-WebSocket-Protocol field
|
||||
fail_if_no_subprotocol = true
|
||||
|
||||
## Comma-separated list of supported subprotocols
|
||||
## Type: Comma Separated List
|
||||
supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"
|
||||
|
||||
## If true, origin HTTP header will be validated against the list of allowed origins configured in check_origins parameter
|
||||
check_origin_enable = false
|
||||
|
||||
## If false and check_origin_enable is true, the server will reject requests that don't have origin HTTP header
|
||||
allow_origin_absence = true
|
||||
|
||||
## List of allowed origins
|
||||
## Type: Comma Separated List
|
||||
check_origins = "http://localhost:18083, http://127.0.0.1:18083"
|
||||
|
||||
## HTTP header used to pass information about the client IP address
|
||||
proxy_address_header = "x-forwarded-for"
|
||||
|
||||
## The maximum length of a single MQTT packet
|
||||
proxy_port_header = "x-forwarded-port"
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
##--------------------------------------------------------------------
|
||||
## WSS Listener
|
||||
##
|
||||
## Add a WSS Listener
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
## The WSS listener supports all the fields listed in listeners.ws.conf.example
|
||||
## only the WSS-specific fields are shown here
|
||||
|
||||
## Note: Modifying the 'wssname' to what you need
|
||||
listeners.wss.wssname {
|
||||
## false to disable this
|
||||
enable = true
|
||||
|
||||
## Port or Address to listen on
|
||||
## Default: 8084
|
||||
bind = 8084 ## or with an IP, e.g. "127.0.0.1:8084"
|
||||
|
||||
## PEM format certificates chain file
|
||||
certfile = "data/certs/cert.pem"
|
||||
|
||||
## PEM format private key file
|
||||
keyfile = "data/certs/key.pem"
|
||||
|
||||
## 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
|
||||
fail_if_no_peer_cert = false
|
||||
|
||||
## Enable TLS session reuse
|
||||
reuse_sessions = true
|
||||
|
||||
## Maximum number of non-self-issued intermediate certificates that can follow the peer certificate in a valid certification path
|
||||
depth = 10
|
||||
|
||||
## Which versions are to be supported
|
||||
versions = [tlsv1.3, tlsv1.2]
|
||||
|
||||
## TLS cipher suite names
|
||||
## Note: By default, all available suites are supported, you do not need to set this
|
||||
ciphers = ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256"]
|
||||
|
||||
## Allows a client and a server to renegotiate the parameters of the SSL connection on the fly
|
||||
secure_renegotiate = true
|
||||
|
||||
## Log level for SSL communication
|
||||
## Type: emergency | alert | critical | error | warning | notice | info | debug | none | all
|
||||
log_level = notice
|
||||
|
||||
## Hibernate the SSL process after idling for amount of time reducing its memory footprint
|
||||
hibernate_after = 5s
|
||||
|
||||
## Forces the cipher to be set based on the server-specified order instead of the client-specified order
|
||||
honor_cipher_order = true
|
||||
|
||||
## Setting this to false to disable client-initiated renegotiation
|
||||
client_renegotiation = true
|
||||
|
||||
## Maximum time duration allowed for the handshake to complete
|
||||
handshake_timeout = 15s
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Log
|
||||
##
|
||||
## Configure the log output location, log level, log file storage path, and parameters
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
log.console {
|
||||
## set true to enable this
|
||||
enable = false
|
||||
|
||||
## Log level
|
||||
## Type: debug | info | notice | warning | error | critical | alert | emergency
|
||||
level = warning
|
||||
|
||||
## Log formatter, text for free text, and json for structured logging
|
||||
## Type: text | json
|
||||
formatter = text
|
||||
|
||||
## Time offset for formatting the timestamp
|
||||
## Type:
|
||||
## - system :: local system time
|
||||
## - utc :: UTC time
|
||||
## - +-[hh]:[mm]: user specified time offset, such as "-02:00" or "+00:00" Defaults to: system
|
||||
time_offset = system
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Log
|
||||
##
|
||||
## Configure the log output location, log level, log file storage path, and parameters
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
## The default-enabled log handler can use all the above fields listed fields
|
||||
log.file {
|
||||
## use false to disable this
|
||||
enable = true
|
||||
|
||||
## Log level
|
||||
## Type: debug | info | notice | warning | error | critical | alert | emergency
|
||||
level = warning
|
||||
|
||||
## Log formatter, text for free text, and json for structured logging
|
||||
## Type: text | json
|
||||
formatter = text
|
||||
|
||||
## Time offset for formatting the timestamp
|
||||
## Type:
|
||||
## - system :: local system time
|
||||
## - utc :: UTC time
|
||||
## - +-[hh]:[mm]: user specified time offset, such as "-02:00" or "+00:00" Defaults to: system
|
||||
time_offset = system
|
||||
|
||||
## Maximum number of log files
|
||||
## Type: Range from 1 to 128
|
||||
rotation_count = 10
|
||||
|
||||
## This parameter controls log file rotation
|
||||
## 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"
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
##--------------------------------------------------------------------
|
||||
## MQTT
|
||||
##
|
||||
## MQTT configuration
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
mqtt {
|
||||
## After the TCP connection is established,
|
||||
## if the MQTT CONNECT packet from the client is not received within the time specified by idle_timeout, the connection will be disconnected
|
||||
## Type:
|
||||
## - infinity :: Never disconnect
|
||||
## - Time Duration :: The idle time
|
||||
idle_timeout = 15s
|
||||
|
||||
## Maximum MQTT packet size allowed
|
||||
max_packet_size = 1MB
|
||||
|
||||
## Maximum allowed length of MQTT Client ID
|
||||
## Type: Rnage from 23 to 65535
|
||||
max_clientid_len = 65535
|
||||
|
||||
## Maximum topic levels allowed
|
||||
## Type: Range from 1 to 65535
|
||||
max_topic_levels = 128
|
||||
|
||||
## Maximum QoS allowed
|
||||
max_qos_allowed = 2
|
||||
|
||||
## Maximum topic alias, 0 means no topic alias supported
|
||||
## Type: Range from 0 to 65535
|
||||
max_topic_alias = 65535
|
||||
|
||||
## Whether to enable support for MQTT retained message
|
||||
retain_available = true
|
||||
|
||||
## Whether to enable support for MQTT wildcard subscription
|
||||
wildcard_subscription = true
|
||||
|
||||
## Whether to enable support for MQTT shared subscription
|
||||
shared_subscription = true
|
||||
|
||||
## Whether to enable support for MQTT exclusive subscription
|
||||
exclusive_subscription = false
|
||||
|
||||
## Ignore loop delivery of messages for MQTT v3.1.1/v3.1.0, similar to No Local subscription option in MQTT 5.0
|
||||
ignore_loop_deliver = false
|
||||
|
||||
## Parse MQTT messages in strict mode.
|
||||
## When set to true, invalid utf8 strings in for example client ID, topic name, etc. will cause the client to be disconnected
|
||||
strict_mode = false
|
||||
|
||||
## Specify the response information returned to the client
|
||||
response_information = ""
|
||||
|
||||
## The keep alive that EMQX requires the client to use
|
||||
## Type:
|
||||
## - disabled :: the keep alive specified by the client will be used
|
||||
## - Integer :: Keepalive time, only applicable to clients using MQTT 5.0 protocol
|
||||
server_keepalive = disabled
|
||||
|
||||
## Keep-Alive Timeout = Keep-Alive interval × Keep-Alive Multiplier
|
||||
keepalive_multiplier = 1.5
|
||||
|
||||
## Maximum number of subscriptions allowed per client
|
||||
## Type: infinity | Integer
|
||||
max_subscriptions = infinity
|
||||
|
||||
## Force upgrade of QoS level according to subscription
|
||||
upgrade_qos = false
|
||||
|
||||
## Maximum number of QoS 1 and QoS 2 messages that are allowed to be delivered simultaneously before completing the acknowledgment
|
||||
## Type: Range from 1 to 65535
|
||||
max_inflight = 32
|
||||
|
||||
## Retry interval for QoS 1/2 message delivering
|
||||
retry_interval = 30s
|
||||
|
||||
## For each publisher session, the maximum number of outstanding QoS 2 messages pending on the client to send PUBREL
|
||||
## Type: infinity | Integer
|
||||
max_awaiting_rel = 100
|
||||
|
||||
## For client to broker QoS 2 message, the time limit for the broker to wait before the PUBREL message is received
|
||||
await_rel_timeout = 300s
|
||||
|
||||
## Specifies how long the session will expire after the connection is disconnected, only for non-MQTT 5.0 connections
|
||||
session_expiry_interval = 2h
|
||||
|
||||
## Maximum queue length. Enqueued messages when persistent client disconnected, or inflight window is full
|
||||
## Type: infinity | Integer
|
||||
max_mqueue_len = 1000
|
||||
|
||||
## Specifies whether to store QoS 0 messages in the message queue while the connection is down but the session remains
|
||||
mqueue_store_qos0 = true
|
||||
|
||||
## Whether to user Client ID as Username
|
||||
use_username_as_clientid = false
|
||||
|
||||
## Use the CN, DN field in the peer certificate or the entire certificate content as Username
|
||||
## Type:
|
||||
## - disabled
|
||||
## - cn :: CN field of the certificate
|
||||
## - dn :: DN field of the certificate
|
||||
## - crt :: the content of the DER or PEM certificate
|
||||
## - pem :: PEM format content converted from DER certificate content
|
||||
## - md5 :: the MD5 value of the content of the DER or PEM certificate
|
||||
peer_cert_as_username = disabled
|
||||
|
||||
## Use the CN, DN field in the peer certificate or the entire certificate content as Client ID
|
||||
## Type: See the above
|
||||
peer_cert_as_clientid = disabled
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Node
|
||||
##
|
||||
## configuring for current EMQX node
|
||||
##--------------------------------------------------------------------
|
||||
## 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: all fields in this section are immutable after EMQX started, and most of the time you only need to modify the value for the name and cookie.
|
||||
node {
|
||||
## The actions triggered when the alarm is activated
|
||||
## Type: Formatted String
|
||||
## Format: any_name@any_domain or an_name@any_ip
|
||||
## Note: Make sure the IP resolve from the domain is deterministic and unique and never change
|
||||
name = "emqx@127.0.0.1"
|
||||
|
||||
## Secret cookie is a random string that should be the same on all nodes in the given EMQX cluster, but unique per EMQX cluster
|
||||
cookie = "Yzc0NGExM2RjYzYxYzM0YzQ5MWQ0NmI1NWM0MWRhMzY4NzgxYmFkMmI2MWJjZWQ5NTQzYTMxNjE1ODVmYmJmMyAgLQo="
|
||||
|
||||
## Select a node role
|
||||
## Type:
|
||||
## - core :: nodes provide durability of the data, and take care of writes
|
||||
## - replicant :: nodes are ephemeral worker nodes
|
||||
role = core
|
||||
|
||||
## Maximum number of simultaneously existing processes for this Erlang system
|
||||
## Type: Range from 1024 to 134217727
|
||||
process_limit = 2097152
|
||||
|
||||
## Maximum number of simultaneously existing ports for this Erlang system
|
||||
## Type: Range from 1024 to 134217727
|
||||
max_ports = 1048576
|
||||
|
||||
## Erlang's distribution buffer busy limit in kilobytes
|
||||
## Type: Range from 1 to 2097152
|
||||
dist_buffer_size = 8192
|
||||
|
||||
## Path to the persistent data directory
|
||||
data_dir = "var/emqx/data"
|
||||
|
||||
## Type: Periodic garbage collection interval
|
||||
global_gc_interval = "15m"
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
##--------------------------------------------------------------------
|
||||
## 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,0 +1,27 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Plugin
|
||||
##
|
||||
## Manage EMQX plugins
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
plugin {
|
||||
## Plugins declaration
|
||||
## Note: The plugins are started in the defined order
|
||||
states = [
|
||||
{
|
||||
## Name and version of this plugin
|
||||
## Type: Formatted String
|
||||
## Format: {name}-{version}
|
||||
## Note: name and version should be what it is in the plugin application
|
||||
name_vsn = "my_acl-0.1.0",
|
||||
|
||||
enable = true ## enable this plugin
|
||||
},
|
||||
{name_vsn = "my_rule-0.1.1", enable = false}
|
||||
]
|
||||
|
||||
## The installation directory for the external plugins
|
||||
install_dir = "plugins"
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Prometheus
|
||||
##
|
||||
## Settings for reporting metrics to Prometheus
|
||||
##--------------------------------------------------------------------
|
||||
|
||||
prometheus {
|
||||
## URL of Prometheus server
|
||||
push_gateway_server = "http://127.0.0.1:9091"
|
||||
|
||||
## Data reporting interval
|
||||
interval = 15s
|
||||
|
||||
## A HTTP Headers when pushing to Push Gateway.
|
||||
headers = {
|
||||
Authorization = "some-authz-tokens",
|
||||
Connection = "keep-alive"
|
||||
}
|
||||
|
||||
## Job Name that is pushed to the Push Gateway.
|
||||
## Available variable:
|
||||
## - ${name}: Name of EMQX node
|
||||
## - ${host}: Host name of EMQX node
|
||||
job_name = "${name}/instance/${name}~${host}"
|
||||
|
||||
## set true to enable this
|
||||
enable = false
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Pre-Shared Keys authentication
|
||||
##
|
||||
## Config to enable TLS-PSK authentication
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
psk_authentication {
|
||||
## set true to enable TLS PSK support
|
||||
enable = false
|
||||
|
||||
## If init_file is specified, EMQX will import PSKs from the file into the built-in database at startup for use by the runtime
|
||||
init_file = "psk"
|
||||
|
||||
## The separator between PSKIdentity and SharedSecret in the PSK file
|
||||
separator = ":"
|
||||
|
||||
## The size of each chunk used to import to the built-in database from PSK file
|
||||
chunk_size = 50
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
##--------------------------------------------------------------------
|
||||
## Retainer
|
||||
##
|
||||
## Configuration related to handling PUBLISH packets with a retain flag set to 1
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
retainer {
|
||||
## set to false to disable this
|
||||
enable = true
|
||||
|
||||
## Message retention time. 0 means message will never be expired
|
||||
msg_expiry_interval = 0s
|
||||
|
||||
## Periodic interval for cleaning up expired messages. Never clear if the value is 0
|
||||
msg_clear_interval = 0s
|
||||
|
||||
## Maximum retained message size
|
||||
max_payload_size = 1MB
|
||||
|
||||
## When the retained flag of the PUBLISH message is set and Payload is empty, whether to continue to publish the message
|
||||
stop_publish_clear_msg = false
|
||||
|
||||
## Maximum retained messages delivery rate per session
|
||||
deliver_rate = "1000/s"
|
||||
|
||||
## Retained messages store backend
|
||||
backend {
|
||||
## Backend type
|
||||
type = built_in_database
|
||||
|
||||
## Specifies whether the messages are stored in RAM or persisted on disc
|
||||
## Type: enum: ram | disc
|
||||
storage_type = ram
|
||||
|
||||
## Maximum number of retained messages. 0 means no limit
|
||||
max_retained_messages = 0
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
##--------------------------------------------------------------------
|
||||
## RPC With SSL
|
||||
## See rpc-with-tcp.conf.example for RPC with TCP
|
||||
## EMQX inter-broker communication
|
||||
##--------------------------------------------------------------------
|
||||
## 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: Most of the time the default config should work
|
||||
## you do not need to modify it unless you know what it is for
|
||||
rpc {
|
||||
## Communication mode
|
||||
## Type: async | sync
|
||||
mode = async
|
||||
|
||||
## Transport protocol used for inter-broker communication
|
||||
## Type: tcp | ssl
|
||||
protocol = ssl
|
||||
|
||||
## The maximum number of batch messages sent in asynchronous mode
|
||||
## Type: Integer
|
||||
async_batch_size = 256
|
||||
|
||||
## Port discovery strategy
|
||||
## Type:
|
||||
## - manual :: discover ports by tcp_server_port
|
||||
## - stateless :: discover ports in a stateless manner, using the following algorithm:
|
||||
## If node name is emqxN@127.0.0.1, where the N is an integer, then the listening port will be 5370 + N
|
||||
port_discovery = stateless
|
||||
|
||||
## Listening port used by RPC local service
|
||||
ssl_server_port = 5369
|
||||
|
||||
## Set the maximum number of RPC communication channels initiated by this node to each remote node
|
||||
## Type: Range from 1 to 256
|
||||
tcp_client_num = 10
|
||||
|
||||
## Timeout for establishing an RPC connection
|
||||
connect_timeout = 5s
|
||||
|
||||
## Path to TLS certificate file used to validate identity of the cluster nodes
|
||||
certfile = "data/cert.pem"
|
||||
|
||||
## Path to the private key file
|
||||
keyfile = "data/key.pem"
|
||||
|
||||
## Path to certification authority TLS certificate file
|
||||
cacertfile = "data/cacert.pem"
|
||||
|
||||
## Timeout for sending the RPC request
|
||||
send_timeout = 5s
|
||||
|
||||
## Timeout for the remote node authentication
|
||||
authentication_timeout = 5s
|
||||
|
||||
## Timeout for the reply to a synchronous RPC
|
||||
call_receive_timeout = 15s
|
||||
|
||||
## How long the connections between the brokers should remain open after the last message is sent
|
||||
socket_keepalive_idle = 15m
|
||||
|
||||
## The interval between keepalive messages
|
||||
socket_keepalive_interval = 75s
|
||||
|
||||
## How many times the keepalive probe message can fail to receive a reply until the RPC connection is considered lost
|
||||
socket_keepalive_count = 9
|
||||
|
||||
## TCP sending buffer size
|
||||
socket_sndbuf = 1MB
|
||||
|
||||
## TCP receiving buffer size
|
||||
socket_recbuf = 1MB
|
||||
|
||||
## Socket buffer size in user mode
|
||||
socket_buffer = 1MB
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
##--------------------------------------------------------------------
|
||||
## RPC With TCP
|
||||
## See rpc-with-ssl.conf.example for RPC with SSL
|
||||
## EMQX inter-broker communication
|
||||
##--------------------------------------------------------------------
|
||||
## 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: Most of the time the default config should work
|
||||
## you do not need to modify it unless you know what it is for
|
||||
rpc {
|
||||
## Communication mode
|
||||
## Type: sync | async
|
||||
mode = async
|
||||
|
||||
## Transport protocol used for inter-broker communication
|
||||
## Type: tcp | ssl
|
||||
protocol = tcp
|
||||
|
||||
## The maximum number of batch messages sent in asynchronous mode
|
||||
## Type: Integer
|
||||
async_batch_size = 256
|
||||
|
||||
## Port discovery strategy
|
||||
## Type:
|
||||
## - manual :: discover ports by tcp_server_port
|
||||
## - stateless :: discover ports in a stateless manner, using the following algorithm:
|
||||
## If node name is emqxN@127.0.0.1, where the N is an integer, then the listening port will be 5370 + N
|
||||
port_discovery = stateless
|
||||
|
||||
## Listening port used by RPC local service
|
||||
tcp_server_port = 5369
|
||||
|
||||
## Set the maximum number of RPC communication channels initiated by this node to each remote node
|
||||
## Type: Range from 1 to 256
|
||||
tcp_client_num = 10
|
||||
|
||||
## Timeout for establishing an RPC connection
|
||||
connect_timeout = 5s
|
||||
|
||||
## Timeout for sending the RPC request
|
||||
send_timeout = 5s
|
||||
|
||||
## Timeout for the remote node authentication
|
||||
authentication_timeout = 5s
|
||||
|
||||
## Timeout for the reply to a synchronous RPC
|
||||
call_receive_timeout = 15s
|
||||
|
||||
## How long the connections between the brokers should remain open after the last message is sent
|
||||
socket_keepalive_idle = 15m
|
||||
|
||||
## The interval between keepalive messages
|
||||
socket_keepalive_interval = 75s
|
||||
|
||||
## How many times the keepalive probe message can fail to receive a reply until the RPC connection is considered lost
|
||||
socket_keepalive_count = 9
|
||||
|
||||
## TCP sending buffer size
|
||||
socket_sndbuf = 1MB
|
||||
|
||||
## TCP receiving buffer size
|
||||
socket_recbuf = 1MB
|
||||
|
||||
## Socket buffer size in user mode
|
||||
socket_buffer = 1MB
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
##--------------------------------------------------------------------
|
||||
## System Topic
|
||||
##
|
||||
## Publishing client lifecycle events to "$SYS" topics
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
sys_topics {
|
||||
## Time interval of publishing `$SYS` messages
|
||||
sys_msg_interval = 1m
|
||||
|
||||
## Time interval for publishing following heartbeat messages:
|
||||
## - `$SYS/brokers/<node>/uptime`
|
||||
## - `$SYS/brokers/<node>/datetime`
|
||||
sys_heartbeat_interval = 30s
|
||||
|
||||
## Client events messages toggle
|
||||
sys_event_messages = {
|
||||
client_connected = true
|
||||
client_disconnected = true
|
||||
client_subscribed = false
|
||||
client_unsubscribed = false
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
##--------------------------------------------------------------------
|
||||
## System Monitoring For System
|
||||
##
|
||||
## System monitoring and introspection
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
sysmon.os {
|
||||
## Time interval for the periodic CPU check
|
||||
cpu_check_interval = "60s"
|
||||
|
||||
## For how much system cpu can be used before the corresponding alarm is raised
|
||||
cpu_high_watermark = "80%"
|
||||
|
||||
## For how much system cpu can be used before the corresponding alarm is cleared
|
||||
cpu_low_watermark = "60%"
|
||||
|
||||
## Time interval for the periodic memory check
|
||||
## Type:
|
||||
## - disabled :: Never check
|
||||
## - Time Duration :: The time period
|
||||
mem_check_interval = "60s"
|
||||
|
||||
## For how much system memory can be allocated before the corresponding alarm is raised
|
||||
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%"
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
##--------------------------------------------------------------------
|
||||
## System Monitoring For Erlang VM
|
||||
##
|
||||
## System monitoring and introspection
|
||||
##--------------------------------------------------------------------
|
||||
## 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
|
||||
|
||||
sysmon.vm {
|
||||
## Time interval for the periodic process limit check
|
||||
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%"
|
||||
|
||||
## For how many processes can simultaneously exist at the local node before the corresponding alarm is cleared
|
||||
process_low_watermark = "60%"
|
||||
|
||||
## Generated an alarm when an Erlang process spends a long time to perform garbage collection
|
||||
## Type:
|
||||
## - disabled :: Never alarm
|
||||
## - Time During :: The maximum GC time for generating an alarm
|
||||
long_gc = 100ms
|
||||
|
||||
## Generating an alarm is generated when the Erlang VM detect a task scheduled for too long
|
||||
## Type:
|
||||
## - disabled :: Never alarm
|
||||
## - Time During :: The maximum schedule time for generating an alarm
|
||||
long_schedule = 240ms
|
||||
|
||||
## Generating an alarm when an Erlang process consumed a large amount of memory for its heap space
|
||||
## Type:
|
||||
## - disabled :: Never alarm
|
||||
## - ByteSize :: The maximum heap size for generating an alarm
|
||||
large_heap = 32M
|
||||
|
||||
## Generating an alarm when the RPC connection is overloaded
|
||||
busy_dist_port = true
|
||||
|
||||
## Generating an alarm when a port (e.g. TCP socket) is overloaded
|
||||
busy_port = true
|
||||
}
|
|
@ -4,7 +4,7 @@ enable.desc:
|
|||
"""Turn Prometheus data pushing on or off"""
|
||||
|
||||
headers.desc:
|
||||
"""A list of HTTP Headers when pushing to Push Gateway.<br/>
|
||||
"""A HTTP Headers when pushing to Push Gateway.<br/>
|
||||
For example, <code> { Authorization = "some-authz-tokens"}</code>"""
|
||||
|
||||
interval.desc:
|
||||
|
|
Loading…
Reference in New Issue