- Configuration
- Configuration
- Cluster
- cluster.name
- cluster.proto_dist
- cluster.discovery
- cluster.autoheal
- cluster.autoclean
- cluster.static.seeds
- cluster.mcast.addr
- cluster.mcast.ports
- cluster.mcast.iface
- cluster.mcast.ttl
- cluster.mcast.loop
- cluster.dns.name
- cluster.dns.app
- cluster.etcd.server
- cluster.etcd.prefix
- cluster.etcd.node_ttl
- cluster.etcd.ssl.keyfile
- cluster.etcd.ssl.certfile
- cluster.etcd.ssl.cacertfile
- cluster.k8s.apiserver
- cluster.k8s.service_name
- cluster.k8s.address_type
- cluster.k8s.app_name
- cluster.k8s.suffix
- cluster.k8s.namespace
- node.name
- node.cookie
- node.data_dir
- node.heartbeat
- node.async_threads
- node.process_limit
- node.max_ports
- node.dist_buffer_size
- node.max_ets_tables
- node.global_gc_interval
- node.fullsweep_after
- node.crash_dump
- node.ssl_dist_optfile
- node.dist_net_ticktime
- node.dist_listen_min
- node.dist_listen_max
- rpc.mode
- rpc.async_batch_size
- rpc.port_discovery
- rpc.tcp_server_port
- rpc.tcp_client_num
- rpc.connect_timeout
- rpc.send_timeout
- rpc.authentication_timeout
- rpc.call_receive_timeout
- rpc.socket_keepalive_idle
- rpc.socket_keepalive_interval
- rpc.socket_keepalive_count
- rpc.socket_sndbuf
- rpc.socket_recbuf
- rpc.socket_buffer
- log.to
- log.level
- log.dir
- log.file
- log.chars_limit
- log.rotation.size
- log.rotation.count
- log..file
- log.max_depth
- log.single_line
- log.formatter
- authacl
- allow_anonymous
- acl_nomatch
- acl_file
- enable_acl_cache
- acl_cache_max_size
- acl_cache_ttl
- acl_deny_action
- flapping_detect_policy
- mqtt.max_packet_size
- mqtt.max_clientid_len
- mqtt.max_topic_levels
- mqtt.max_qos_allowed
- mqtt.max_topic_alias
- mqtt.retain_available
- mqtt.wildcard_subscription
- mqtt.shared_subscription
- mqtt.ignore_loop_deliver
- mqtt.strict_mode
- zone.external.idle_timeout
- zone.external.enable_acl
- zone.external.enable_ban
- zone.external.enable_stats
- zone.external.acl_deny_action
- zone.external.force_gc_policy
- zone.external.force_shutdown_policy
- zone.external.max_packet_size
- zone.external.max_clientid_len
- zone.external.max_topic_levels
- zone.external.max_qos_allowed
- zone.external.max_topic_alias
- zone.external.retain_available
- zone.external.wildcard_subscription
- zone.external.shared_subscription
- zone.external.server_keepalive
- zone.external.keepalive_backoff
- zone.external.max_subscriptions
- zone.external.upgrade_qos
- zone.external.max_inflight
- zone.external.retry_interval
- zone.external.max_awaiting_rel
- zone.external.await_rel_timeout
- zone.external.session_expiry_interval
- zone.external.max_mqueue_len
- zone.external.mqueue_priorities
- zone.external.mqueue_default_priority
- zone.external.mqueue_store_qos0
- zone.external.enable_flapping_detect
- zone.external.mountpoint
- zone.external.use_username_as_clientid
- zone.external.ignore_loop_deliver
- zone.external.strict_mode
- zone.internal.allow_anonymous
- zone.internal.enable_stats
- zone.internal.enable_acl
- zone.internal.acl_deny_action
- zone.internal.force_gc_policy
- zone.internal.wildcard_subscription
- zone.internal.shared_subscription
- zone.internal.max_subscriptions
- zone.internal.max_inflight
- zone.internal.max_awaiting_rel
- zone.internal.max_mqueue_len
- zone.internal.mqueue_store_qos0
- zone.internal.enable_flapping_detect
- zone.internal.force_shutdown_policy
- zone.internal.mountpoint
- zone.internal.ignore_loop_deliver
- zone.internal.strict_mode
- zone.internal.bypass_auth_plugins
- listener.tcp.external
- listener.tcp.external.acceptors
- listener.tcp.external.max_connections
- listener.tcp.external.max_conn_rate
- listener.tcp.external.active_n
- listener.tcp.external.zone
- listener.tcp.external.rate_limit
- listener.tcp.external.access.1
- listener.tcp.external.proxy_protocol
- listener.tcp.external.proxy_protocol_timeout
- listener.tcp.external.peer_cert_as_username
- listener.tcp.external.peer_cert_as_clientid
- listener.tcp.external.backlog
- listener.tcp.external.send_timeout
- listener.tcp.external.send_timeout_close
- listener.tcp.external.recbuf
- listener.tcp.external.sndbuf
- listener.tcp.external.buffer
- listener.tcp.external.tune_buffer
- listener.tcp.external.nodelay
- listener.tcp.external.reuseaddr
- listener.tcp.internal
- listener.tcp.internal.acceptors
- listener.tcp.internal.max_connections
- listener.tcp.internal.max_conn_rate
- listener.tcp.internal.active_n
- listener.tcp.internal.zone
- listener.tcp.internal.rate_limit
- listener.tcp.internal.backlog
- listener.tcp.internal.send_timeout
Configuration
Configuration
Cluster
cluster.name
| Type | Default |
|---|---|
| string | emqxcl |
Description
Cluster name.
cluster.proto_dist
| Type | Optional Value | Default |
|---|---|---|
| enum | inet_tcp, inet6_tcp, inet_tls |
inet_tcp |
Description
Distributed Erlang cluster protocol type. Available values are:
inet_tcp: using IPv4inet6_tcp: using IPv6inet_tls: using TLS, required to be used withnode.ssl_dist_optfileconfiguration
cluster.discovery
| Type | Optional Value | Default |
|---|---|---|
| enum | manual, static, mcast, dns, etcd, k8s |
manual |
Description
Cluster node discovery method. Available values are:
manual: join the cluster manuallystatic: Configure static nodes. Configure several fixed nodes, and the new node joins the cluster by connecting one of the fixed nodes.mcast: Use UDP multicast to discover nodes.dns: Use DNS A records to discover nodes.etcd: Use etcd to discover nodes.k8s: Use Kubernetes to discover nodes.
cluster.autoheal
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Enable or disable the automatic recovery mechanism of cluster brain splitting.
cluster.autoclean
| Type | Default |
|---|---|
| duration | 5m |
Description
Specify how long to delete short-line nodes from the cluster.
cluster.static.seeds
| Type | Default | Example |
|---|---|---|
| string | - | emqx1@192.168.0.100,emqx2@192.168.0.101 |
Description
When using static clustering, specify a fixed list of nodes, separated by commas , between multiple nodes.
cluster.mcast.addr
| Type | Default |
|---|---|
| ipaddr | 239.192.0.1 |
Description
When using the mcast cluster, specify the multicast address.
cluster.mcast.ports
| Type | Default |
|---|---|
| string | 4369 |
Description
When using the mcast cluster, specify the multicast port. If there are multiple ports, separate them with commas ,.
cluster.mcast.iface
| Type | Default |
|---|---|
| ipaddr | 0.0.0.0 |
Description
When using mcast cluster, specify which local IP address the node discovery service needs to bind to.
cluster.mcast.ttl
| Type | Default |
|---|---|
| integer | 255 |
Description
When using mcast cluster, specify the Time-To-Live value of multicast.
cluster.mcast.loop
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
When using mcast clustering, set whether multicast packets are delivered to the local loopback address.
cluster.dns.name
| Type | Default | Example |
|---|---|---|
| string | - | mycluster.com |
Description
When using the dns cluster, specify the name of the DNS A record. emqx will access the DNS A record to obtain a list of IP addresses, and then splice the APP name specified in cluster.dns.app to get a list of all nodes in the cluster.
Example
Set cluster.dns.app = emqx, and configure a DNS: mycluster.com, which points to 3 IP addresses:
192.168.0.100
192.168.0.101
192.168.0.102
Then get the list of cluster nodes as follows:
emqx@192.168.0.100
emqx@192.168.0.101
emqx@192.168.0.102
cluster.dns.app
| Type | Default | Example |
|---|---|---|
| string | - | emqx |
Description
When using dns cluster, it is used to splice the IP list obtained from cluster.dns.name to get a list of node names.
cluster.etcd.server
| Type | Default | Example |
|---|---|---|
| string | - | <http://127.0.0.1:2379> |
Description
When using etcd cluster, specify the address of etcd service. If there are multiple services, use commas to separate them.
cluster.etcd.prefix
| Type | Default | Example |
|---|---|---|
| string | - | emqxcl |
Description
When using etcd cluster, specify the prefix of etcd path. Each node creates a path in etcd:
v2/keys/<prefix>/<cluster.name>/<node.name>
cluster.etcd.node_ttl
| Type | Default | Example |
|---|---|---|
| duration | - | 1m |
Description
When using etcd cluster, specify the expiration time of the node path in etcd.
cluster.etcd.ssl.keyfile
| Type | Default | Example |
|---|---|---|
| string | - | etc/certs/client-key.pem |
Description
When using SSL to connect to etcd, specify the client’s private key file.
cluster.etcd.ssl.certfile
| Type | Default | Example |
|---|---|---|
| string | - | etc/certs/client.pem |
Description
When using SSL to connect to etcd, specify the SSL client certificate file.
cluster.etcd.ssl.cacertfile
| Type | Default | Example |
|---|---|---|
| string | - | etc/certs/ca.pem |
Description
When using SSL to connect to etcd, specify the CA certificate file for SSL.
cluster.k8s.apiserver
| Type | Default | Example |
|---|---|---|
| string | - | <http://10.110.111.204:8080> |
Description
When using the k8s cluster, specify the Kubernetes API Server. If there are multiple Servers, separate them with commas ,.
cluster.k8s.service_name
| Type | Default | Example |
|---|---|---|
| string | - | emqx |
Description
When using k8s cluster, specify the service name of EMQ X Broker in Kubernetes.
cluster.k8s.address_type
| Type | Optional Value | Default |
|---|---|---|
| enum | ip, dns, hostname |
ip |
Description
When using k8s cluster, address_type is used to obtain the host list from the response of the Kubernetes interface.
Example
Specifying cluster.k8s.address_type as ip, it will get the list of IP addresses of emqx services from the Kubernetes interface:
172.16.122.31
172.16.122.32
172.16.122.33
Then splice with the app name specified by cluster.k8s.app_name configuration to get a list of emqx nodes:
emqx@172.16.122.31
emqx@172.16.122.32
emqx@172.16.122.33
cluster.k8s.app_name
| Type | Default | Example |
|---|---|---|
| string | - | emqx |
Description
When using k8s clustering, app_name is used to splice with the obtained Host list to get the node list.
cluster.k8s.suffix
| Type | Default | Example |
|---|---|---|
| string | - | pod.cluster.local |
Description
When using the k8s method and specifying cluster.k8s.address_type as the dns type, you can set the suffix of the emqx node name, and splice with cluster.k8s.namespace to get a list of node names.
cluster.k8s.namespace
| Type | Default | Example |
|---|---|---|
| string | - | default |
Description
When using the k8s method and specifying cluster.k8s.address_type as the dns type, you can set the namespace of the emqx node name, and splice with cluster.k8s.suffix to get a list of node names.
Example
Setting cluster.k8s.address_type to dns, you will get the dns list of emqx service from the Kubernetes interface:
172-16-122-31
172-16-122-32
172-16-122-33
Then splice with cluster.k8s.app_name = emqx,cluster.k8s.suffix = pod.cluster.local,cluster.k8s.namespace = default to get a list of emqx node names in the form of dns:
emqx@172-16-122-31.default.pod.cluster.local
emqx@172-16-122-32.default.pod.cluster.local
emqx@172-16-122-33.default.pod.cluster.local
node.name
| Type | Default |
|---|---|
| string | emqx@127.0.0.1 |
Description
The node name. The format is <name> @ <host>. Where <host> can be an IP address or FQDN. See http://erlang.org/doc/reference_manual/distributed.html
(opens new window) for details
node.cookie
| Type | Default |
|---|---|
| string | emqxsecretcookie |
Description
The cookie value used by the distributed Erlang cluster.
node.data_dir
| Type | Default |
|---|---|
| folder | ./data |
Description
The node’s data directory, which is used to store Mnesia data files.
node.heartbeat
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
off |
Description
System tuning parameters. This configuration will override the -heart parameter in the vm.args file.
Enable or disable Erlang runtime detection mechanism, and restart automatically when the runtime terminates. Use with care to avoid restarting the monitored process when emqx is closed manually.
node.async_threads
| Type | Optional Value | Default |
|---|---|---|
| integer | 0 - 1024 | 4 |
Description
System tuning parameters. This configuration will override the +A parameter in the vm.args file.
Set the number of threads in the asynchronous thread pool in Erlang runtime, see http://erlang.org/doc/man/erl.html
(opens new window) for details.
node.process_limit
| Type | Optional Value | Default |
|---|---|---|
| integer | 1024 - 134217727 | 2097152 |
Description
System tuning parameters. This configuration will override the +P parameter in the vm.args file.
Set the maximum number of processes allowed by Erlang, which will affect the number of connections that emqx nodes can process. See http://erlang.org/doc/man/erl.html
(opens new window) for details.
node.max_ports
| Type | Optional Value | Default |
|---|---|---|
| integer | 1024 - 134217727 | 1048576 |
Description
System tuning parameters. This configuration will override the +Q parameter in the vm.args file.
Set the maximum number of ports allowed by Erlang. See http://erlang.org/doc/man/erl.html
(opens new window) for details.
node.dist_buffer_size
| Type | Optional Value | Default |
|---|---|---|
| bytesize | 1KB - 2GB | 8MB |
Description
System tuning parameters. This configuration will override the +zdbbl parameter in the vm.args file.
Set the maximum cache size used by Erlang distributed communication. See http://erlang.org/doc/man/erl.html
(opens new window) for details.
node.max_ets_tables
| Type | Default |
|---|---|
| integer | 262144 |
Description
System tuning parameters. This configuration will override the +e parameter in the vm.args file.
Set the maximum number of ETS tables allowed in Erlang runtime. See http://erlang.org/doc/man/erl.html
(opens new window) for details.
node.global_gc_interval
| Type | Default |
|---|---|
| duration | 15m |
Description
System tuning parameters, which set how often Erlang runs to force a global garbage collection.
node.fullsweep_after
| Type | Optional Value | Default |
|---|---|---|
| integer | 0 - 65535 | 1000 |
Description
System tuning parameters. This configuration will override the -env ERL_FULLSWEEP_AFTER parameter in the vm.args file.
Set how many times the generational GC will run before Erlang runs a fullsweep GC. For details, see http://erlang.org/doc/man/erlang.html#spawn_opt-4
(opens new window).
node.crash_dump
| Type | Default |
|---|---|
| string | log/crash.dump |
Description
Set the storage path and file name of the Erlang crash_dump file.
node.ssl_dist_optfile
| Type | Default |
|---|---|
| string | etc/ssl_dist.conf |
Description
This configuration will override the -ssl_dist_optfile parameter in the vm.args file.
If you use SSL to establish an emqx cluster, you need to specify the SSL distributed protocol configuration file. It needs to be used with cluster.proto_dist = inet_tls.
node.dist_net_ticktime
| Type | Default |
|---|---|
| integer | 120 |
Description
System tuning parameters. This configuration will override the -kernel net_ticktime parameter in the vm.args file.
Specifying how long time when a node has been unresponsive, it is considered to be down and disconnected. For details, see http://www.erlang.org/doc/man/kernel_app.html#net_ticktime
(opens new window).
node.dist_listen_min
| Type | Optional Value | Default |
|---|---|---|
| integer | 1024 - 65535 | 6369 |
Description
Set a TCP port range together with node.dist_listen_max. This port ranget is used for distribution to distributed Erlang as a listening port for distributed channels. Note that if a firewall is set between nodes, this port range needs to be placed into the firewall’s whitelist.
node.dist_listen_max
| Type | Optional Value | Default |
|---|---|---|
| integer | 1024 - 65535 | 6369 |
Description
Set a TCP port range together with node.dist_listen_min. This port range is used for distribution to distributed Erlang as a listening port for distributed channels. Note that if a firewall is set up between nodes, this port rangeneeds to be put in The firewall’s whitelist.
rpc.mode
| Type | Optional Value | Default |
|---|---|---|
| enum | sync, async |
async |
Description
RPC mode. Synchronous or asynchronous mode is optional.
rpc.async_batch_size
| Type | Default |
|---|---|
| integer | 256 |
Description
The maximum number of batch messages sent in asynchronous mode. Note that this configuration does not work in synchronous mode.
rpc.port_discovery
| Type | Optional Value Default |
|---|---|
| enum | manual, stateless |
Description
manual: discover ports by tcp_server_port and tcp_client_port. stateless: discover ports in a stateless manner. If node name is emqx<N>@127.0.0.1, where the <N> is an integer, then the listening port will be 5370 + <N>
Default is manual when started from docker (environment variable override from docker-entrypoint) otherwise stateless.
rpc.tcp_server_port
| Type | Optional Value | Default |
|---|---|---|
| integer | 1024 - 65535 | 5369 |
Description
Set the listening port used by RPC local service NOTE: this config only takes effect when rpc.port_discovery is set to manual
rpc.tcp_client_num
| Type | Optional Value | Default |
|---|---|---|
| integer | 1 - 256 | CPU core number / 2 |
Description
Set the number of RPC communication channels initiated by this node to each remote node. Set to 1 to ensure the order of messages. Keep the default value (half the number of CPU cores) to improve RPC throughput.
rpc.connect_timeout
| Type | Default |
|---|---|
| duration | 5s |
Description
Timeout for establishing an RPC connection. It means how long will it give up after trying if the remote node does not respond when establishing a connection, .
rpc.send_timeout
| Type | Default |
|---|---|
| duration | 5s |
Description
Timeout for sending, which means how long to give up after sending the message.
rpc.authentication_timeout
| Type | Default |
|---|---|
| duration | 5s |
Description
RPC authentication timeout. It means how long it will give up if the remote node does not respond, .
rpc.call_receive_timeout
| Type | Default |
|---|---|
| duration | 15s |
Description
The timeout period of RPC synchronous mode. It means how long it will take before giving up if the RPC synchronous call fails to receive a reply.
rpc.socket_keepalive_idle
| Type | Default |
|---|---|
| duration | 900s |
Description
It means how long after the last packet was sent, keepalive probe packets are sent.
rpc.socket_keepalive_interval
| Type | Default |
|---|---|
| duration | 75s |
Description
The interval between keepalive detection messages.
rpc.socket_keepalive_count
| Type | Default |
|---|---|
| integer | 9 |
Description
For how many times if the keepalive probe message fails to receive a reply, the RPC connection is considered lost.
rpc.socket_sndbuf
| Type | Default |
|---|---|
| bytesize | 1MB |
Description
TCP tuning parameters. TCP sending buffer size.
rpc.socket_recbuf
| Type | Default |
|---|---|
| bytesize | 1MB |
Description
TCP tuning parameters. TCP receiving buffer size.
rpc.socket_buffer
| Type | Default |
|---|---|
| bytesize | 1MB |
Description
TCP tuning parameters. Socket buffer size in user mode.
log.to
| Type | Optional Value | Default |
|---|---|---|
| enum | off, file, console, both |
both |
Description
Where to output the log. The optional values are:
- off: Disable logging completely
- file: Only output log to file
- console: Only output logs to standard output (emqx console)
- both: output log to file and standard output at the same time (emqx console)
log.level
| Type | Optional Value | Default |
|---|---|---|
| enum | debug, info, notice, warning |
|
error, critical, alert, emergency |
warning |
Description
Global log level. This includes the primary log level and all log handlers. For details, see log level and log handlers.
log.dir
| Type | Default |
|---|---|
| dir | ./log |
Description
Log file directory.
log.file
| Type | Default |
|---|---|
| string | emqx.log |
Description
The prefix of the log file. For example, if you use the default value (log.file = emqx.log), the log file name will be emqx.log.1, emqx.log.2, …
log.chars_limit
| Type | Default |
|---|---|
| integer | -1 |
Description
Set the maximum length of a single log message. If this length is exceeded, the log message will be truncated. -1 means no limit.
log.rotation.size
| Type | Default |
|---|---|
| bytesize | 10MB |
Description
Set the size of a single log file. If it exceeds this size, the log file will be rolled to create a new log file.
log.rotation.count
| Type | Default |
|---|---|
| integer | 5 |
Description
Set the total number of log files. If this number is exceeded, the next log file will overwrite the first file.
log..file
| Type | Default |
|---|---|
| string | - |
Description
Set a separate log file for a certain log level.
Example
Separately output info and above logs to info.log.N file:
log.info.file = info.log
Output error and error logs separately to the error.log.N file
log.error.file = error.log
log.max_depth
| Type | Default |
|---|---|
| integer | 20 |
Description
Max depth when printing large data blob to log. Exceeding parts will be logge as ‘…’.
log.single_line
| Type | Default |
|---|---|
| boolean | true |
Description
Print logs in a single line if set to true. If set to false, information like stacktraces in crash logs may span multiple lines.
log.formatter
| Type | Optional Value | Default |
|---|---|---|
| enum | text, json |
text |
Description
Choose log format. text for free text, and json for structured logging.
authacl
allow_anonymous
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether to allow anonymous users to log in to the system.
Tip
It is recommended to disable this option in the production environment.
acl_nomatch
| Type | Optional Value | Default |
|---|---|---|
| enum | allow, deny |
allow |
Description
When the ACL is not hit, allow or deny the publish/subscribe operation.
acl_file
| Type | Default |
|---|---|
| string | etc/acl.conf |
Description
The default path of ACL file.
enable_acl_cache
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Whether to enable ACL caching.
acl_cache_max_size
| Type | Default |
|---|---|
| integer | 32 |
Description
Maximum cache number of ACL rule.
acl_cache_ttl
| Type | Default |
|---|---|
| duration | 1m |
Description
Maximum cache time of ACL rule.
acl_deny_action
| Type | Optional Value | Default |
|---|---|---|
| enum | ignore, disconnect |
ignore |
Description
What to do after the ACL check fails.
ignore:No operationdisconnect:disconnect.
flapping_detect_policy
| Type | Default |
|---|---|
| string | 30, 1m, 5m |
Description
Specify the Flapping inspection strategy.
Format:,,`.
For example, 30, 1m, 5m, it means that if the client disconnects 30 times within 1 minute, then login is prohibited for the next 5 minutes
mqtt.max_packet_size
| Type | Default |
|---|---|
| bytesize | 1MB |
Description
The maximum allowed length of MQTT messages.
mqtt.max_clientid_len
| Type | Default |
|---|---|
| integer | 65535 |
Description
The maximum allowed length of Client ID string.
mqtt.max_topic_levels
| Type | Default |
|---|---|
| integer | 0 |
Description
The maximum allowed level of topics for client subscription. 0 means no limit.
mqtt.max_qos_allowed
| Type | Optional Value | Default |
|---|---|---|
| enum | 0, 1, 2 |
2 |
Description
The maximum allowed QoS level for client to publish.
mqtt.max_topic_alias
| Type | Default |
|---|---|
| integer | 65535 |
Description
The maximum allowed number of topic aliases. 0 means that topic aliases are not supported.
mqtt.retain_available
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether to support Retain message.
mqtt.wildcard_subscription
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether to support subscribing to wildcard topics.
mqtt.shared_subscription
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether to support shared subscriptions.
mqtt.ignore_loop_deliver
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to ignore the message sent by itself. If it is ignored, it means that EMQ X Broker will not deliver this message to the sender of the message.
mqtt.strict_mode
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to enable the strict check mode. The strict check mode will check the correctness of the MQTT message in more detail.
zone.external.idle_timeout
| Type | Default |
|---|---|
| duration | 15s |
Description
The daze time after the TCP connection is established. If no packets are received within this time, the connection will be shutdown.
zone.external.enable_acl
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Whether to enable ACL check.
zone.external.enable_ban
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Whether to enable blacklist.
zone.external.enable_stats
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Whether to enable client status statistics.
zone.external.acl_deny_action
| Type | Optional Value | Default | | —— | —————————— - | ———— | | enum | ignore, disconnect | ignore |
Description
What to do after the ACL check fails.
ignore:No any operation.disconnect:disconnect.
zone.external.force_gc_policy
| Type | Default |
|---|---|
| string | 16000|16MB |
Description
When a certain number of messages, or bytes, are received, a garbage collection is forced.
Format: <Number> | <Bytes>.
For example, 16000|16MB means that when 16000 messages are received, or a byte of 16MB flows in, a garbage collection is forced.
zone.external.force_shutdown_policy
| Type | Default |
|---|---|
| string | - |
Description
When the process message queue length, or the memory bytes reaches a certain value, the process is forced to close.
The “message queue” here refers to the “message mailbox” of the Erlang process, not the “mqueue” of QoS 1 and QoS 2.
Format: <Number> | <Bytes>.
For example, 32000|32MB means that when the process accumulates 32000 messages, or the process occupies memory up to 32MB, the process is closed.
zone.external.max_packet_size
| Type | Default |
|---|---|
| bytesize | - |
Description
The maximum allowed length of MQTT packet.
zone.external.max_clientid_len
| Type | Default |
|---|---|
| integer | - |
Description
The maximum length of Client ID string.
zone.external.max_topic_levels
| Type | Default |
|---|---|
| integer | - |
Description
The maximum allowed level of topics for client subscription. 0 means no limit.
zone.external.max_qos_allowed
| Type | Optional Value | Default |
|---|---|---|
| enum | 0, 1, 2 |
- |
Description
The maximum QoS level allowed for the client to publish.
zone.external.max_topic_alias
| Type | Default |
|---|---|
| integer | - |
Description
The maximum number of topic aliases. 0 means that topic aliases are not supported.
zone.external.retain_available
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
- |
Description
Whether to support Retain message.
zone.external.wildcard_subscription
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
- |
Description
Whether to support subscribing to wildcard topics.
zone.external.shared_subscription
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
- |
Description
Whether to support shared subscriptions.
zone.external.server_keepalive
| Type | Default |
|---|---|
| integer | - |
Description
Keepalive time specified by the server, used for MQTT v5.0 CONNACK messages
zone.external.keepalive_backoff
| Type | Optional Value | Default |
|---|---|---|
| float | > 0.5 | 0.75 |
Description
Keepalive backoff index. If no data packet is received from the client within the time of Keepalive * backoff * 2, it is considered that the client has heartbeat timeout.
zone.external.max_subscriptions
| Type | Default |
|---|---|
| integer | 0 |
Description
The maximum number of topics that a single client is allowed to subscribe to. 0 means no limit.
zone.external.upgrade_qos
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
off |
Description
Allow EMQ X Broker to force the QoS level of the message upgrading to the subscribed QoS level when publishing the message.
zone.external.max_inflight
| Type | Default |
|---|---|
| integer | 32 |
Description
Inflight window size: The inflight window is used to store unacknowledged QoS 1 and QoS 2 messages.
zone.external.retry_interval
| Type | Default |
|---|---|
| duration | 30s |
Description
Message retransmission interval: EMQ X Broker checks whether message retransmission is required at each interval.
zone.external.max_awaiting_rel
| Type | Default |
|---|---|
| integer | 100 |
Description
The maximum receiving window for QoS 2 messages, which configures how many QoS 2 messages from the client can be processed by EMQ X Broker simultaneously. 0 means no limit.
zone.external.await_rel_timeout
| Type | Default |
|---|---|
| duration | 300s |
Description
Time for QoS 2 message processing timeout. If the QoS PUBREL message has not been received after the timeout, the message is dropped from the receiving window.
zone.external.session_expiry_interval
| Type | Default |
|---|---|
| duration | 2h |
Description
The default timeout period of the session, which is mainly used for MQTT v3.1 and v3.1.1 protocols. In MQTT v5.0, this value is usually carried in the client’s connection message.
zone.external.max_mqueue_len
| Type | Default |
|---|---|
| integer | 1000 |
Description
The maximum length of the message queue. When the flight window is full, or the client is offline, the message will be stored in the queue. 0 means no limit.
zone.external.mqueue_priorities
| Type | Optional Value | Default |
|---|---|---|
| string | none, <Spec> |
none |
Description
Queue message priority configuration:
none:no prioritization.<Spec>:A message priority table, which configures the priority of messages under a certain topic. For example:topic/1=10: indicates that the message priority of the topictopic/1is10.topic/1=10,topic/2=8: indicates that the priority of two topics is configured, which are10and8respectively.- Among them, the higher the priority value, the higher the priority level.
When the length of the message queue is limited, low priority messages will be dropped first.
zone.external.mqueue_default_priority
| Type | Optional Value | Default |
|---|---|---|
| enum | highest, lowest |
highest |
Description
The default priority level of the message.
zone.external.mqueue_store_qos0
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether the message queue stores QoS 0 messages.
zone.external.enable_flapping_detect
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
off |
Description
Whether to enable Flapping check.
zone.external.mountpoint
| Type | Default |
|---|---|
| string | - |
Description
After topic mount point is configured, all subscribed and published topics will be prefixed by EMQ X Broker.
The available placeholders are:
%c:Client ID.%u:Username.
For example, if the mount point is set to user/%c/. , when the client with client ID tom publishes the topic open message, the topic actually routed in EMQ X Broker is user/tom/open.
zone.external.use_username_as_clientid
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to use the client’s Username as its Client ID.
zone.external.ignore_loop_deliver
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to ignore the message sent by yourself. If ignored, it means that EMQ X Broker will not deliver this message to the sender of the message.
zone.external.strict_mode
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to enable the strict check mode. The strict check mode will check the correctness of the MQTT message in more detail.
zone.internal.allow_anonymous
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether to allow anonymous users to log in to the system.
zone.internal.enable_stats
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Whether to enable client status statistics.
zone.internal.enable_acl
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
off |
Description
Whether to enable ACL check.
zone.internal.acl_deny_action
| Type | Optional Value | Default |
|---|---|---|
| enum | ignore, disconnect |
ignore |
Description
What to do after the ACL check fails.
ignore:No operation.disconnect:Disconnect.
zone.internal.force_gc_policy
| Type | Default |
|---|---|
| string | - |
Description
When a certain number of messages, or bytes, are received, a garbage collection is forced.
Format: <Number> | <Bytes>.
For example, 16000|16MB means that when 16000 messages are received, or a byte of 16MB flows in, a garbage collection is forced.
zone.internal.wildcard_subscription
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
- |
Description
Whether to support subscribing to wildcard topics.
zone.internal.shared_subscription
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
- |
Description
Whether to support shared subscriptions.
zone.internal.max_subscriptions
| Type | Default |
|---|---|
| integer | 0 |
Description
The maximum number of topics that a single client is allowed to subscribe to. 0 means no limit.
zone.internal.max_inflight
| Type | Default |
|---|---|
| integer | 128 |
Description
Inflight window size: The flight window is used to store unanswered QoS 1 and QoS 2 messages.
zone.internal.max_awaiting_rel
| Type | Default |
|---|---|
| integer | 1000 |
Description
The maximum receiving window for QoS 2 messages, that configures how many QoS 2 messages from the client can be processed by EMQ X Broker simultaneously. 0 means no limit.
zone.internal.max_mqueue_len
| Type | Default |
|---|---|
| integer | 10000 |
Description
The maximum length of the message queue. When the flight window is full, or the client is offline, the message will be stored in the queue. 0 means no limit.
zone.internal.mqueue_store_qos0
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether the message queue stores QoS 0 messages.
zone.internal.enable_flapping_detect
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
off |
Description
Whether to enable Flapping check.
zone.internal.force_shutdown_policy
| Type | Default |
|---|---|
| string | - |
Description
When the process message queue length, or the memory bytes reaches a certain value, the process is forced to close.
The “message queue” here refers to the “message mailbox” of the Erlang process, not the “mqueue” of QoS 1 and QoS 2.
Format: <Number> | <Bytes>.
For example, 32000|32MB means that when the process accumulates 32000 messages, or the process occupies memory up to 32MB, the process is closed.
zone.internal.mountpoint
| Type | Default |
|---|---|
| string | - |
Description
After topic mount point is configured, all subscribed and published topics will be prefixed by EMQ X Broker.
The available placeholders are:
%c:Client ID.%u:Username.
For example, if the mount point is set to user/%c/. , when the client with client ID tom publishes the topic open message, the topic actually routed in EMQ X Broker is user/tom/open.
zone.internal.ignore_loop_deliver
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to ignore the message sent by itself. If ignored, it means that EMQ X Broker will not deliver this message to the sender of the message.
zone.internal.strict_mode
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
false |
Description
Whether to enable the strict check mode. The strict check mode will check the correctness of the MQTT message in more detail.
zone.internal.bypass_auth_plugins
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
Whether to allow clients under this zone to bypass the authentication step of the authentication plugin.
listener.tcp.external
| Type | Default |
|---|---|
| string | 0.0.0.0:1883 |
Description
Configure the listening address of the MQTT / TCP listener named external.
Example
1883: monitors IPv4 0.0.0.0: 1883. 127.0.0.1: 1883: monitor address is 1883 port on the 127.0.0.1 network card. :: 1: 1883: monitors the IPv6 address as 1883 port on the :: 1 network card.
listener.tcp.external.acceptors
| Type | Default |
|---|---|
| integer | 8 |
Description
The size of the listener’s receiving pool.
listener.tcp.external.max_connections
| Type | Default |
|---|---|
| integer | 1024000 |
Description
The maximum number of concurrent connections allowed by the listener.
listener.tcp.external.max_conn_rate
| Type | Default |
|---|---|
| integer | 1000 |
Description
The maximum access rate allowed by the listener. Unit: pcs / sec
listener.tcp.external.active_n
| Type | Default |
|---|---|
| integer | 100 |
Description
The number of times the listener continues to receive TCP packets.
listener.tcp.external.zone
| Type | Default |
|---|---|
| string | external |
Description
The configuration zone to which the listener belongs.
listener.tcp.external.rate_limit
| Type | Default |
|---|---|
| string | - |
Description
The rate limit of the listener. The format is <limit>,<duration>.
Example
100KB,10s:Limit the number of incoming bytes within 10 seconds not to exceed 100 KB.
listener.tcp.external.access.1
| Type | Default |
|---|---|
| string | allow all |
Description
List of ACL rules of the listener. It is used to set the white/black list of the connection layer.
Example
allow all:Allow all TCP connections. allow 192.168.0.0/24:Allow TCP connection with network address 192.168.0.0/24.
At the same time, this configuration can configure multiple rules:
listener.tcp.external.access.1 = deny 192.168.0.1
listener.tcp.external.access.2 = allow all
It means that all TCP connections except 192.168.0.1 are allowed.
listener.tcp.external.proxy_protocol
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
- |
Description
Whether the listener enables Proxy Protocol support.
If the EMQ X cluster is deployed behind HAProxy or Nginx, and you need to get the client’s real source IP address and port, you need to enable this configuration.
Proxy Protcol : https://www.haproxy.com/blog/haproxy/proxy-protocol
(opens new window).
listener.tcp.external.proxy_protocol_timeout
| Type | Default |
|---|---|
| duration | - |
Description
Set the timeout for Proxy Protocol parsing. If no Proxy Protocol packet is received within this time, EMQ X Broker will close its connection.
listener.tcp.external.peer_cert_as_username
| Type | Optional Value | Default |
|---|---|---|
| enum | cn, dn, crt, pem, md5 |
cn |
Description
Use the client certificate to override the value of the Username field. The optional values are:
- cn: the Common Name of the client certificate
- dn: the Subject Name of the client certificate
- crt: the DER-encoded binary of the client certificate
- pem: base64 encoded string based on the DER-encoded binary
- md5: MD5 hash of the DER-encoded binary
Note: Under TCP listener, this configuration is only available if the load balancing server terminates the SSL deployment; and the load balancing server needs to be configured to send the content of the certificate domain to EMQ X. For example, for HAProxy, see send-proxy-v2-ssl
(opens new window)
listener.tcp.external.peer_cert_as_clientid
| Type | Optional Value | Default |
|---|---|---|
| enum | cn, dn, crt, pem, md5 |
cn |
Description
Use the client certificate to override the value of the ClientID field. The meaning of the optional values is the same as above.
listener.tcp.external.backlog
| Type | Default |
|---|---|
| integer | 1024 |
Description
The maximum length of the TCP connection queue. It indicates the maximum number of TCP connection queues that are allowed in the system to undergo three-time handshake.
listener.tcp.external.send_timeout
| Type | Default |
|---|---|
| duration | 15s |
Description
Timeout for sending TCP packets.
listener.tcp.external.send_timeout_close
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
on |
Description
Whether to close the connection after TCP packet sending timeout.
listener.tcp.external.recbuf
| Type | Default |
|---|---|
| bytesize | - |
Description
TCP receiving buffer size (operating system kernel parameter)
Reference: <http://erlang.org/doc/man/inet.html>
listener.tcp.external.sndbuf
| Type | Default |
|---|---|
| bytesize | - |
Description
TCP sending buffer size (operating system kernel parameter).
Reference:http://erlang.org/doc/man/inet.html
(opens new window).
listener.tcp.external.buffer
| Type | Default |
|---|---|
| bytesize | - |
Description
TCP buffer size (user level).
This value is recommended to be greater than or equal to the maximum value of sndbuff and recbuff to avoid some performance problems. Without configuration, it equals to the maximum value of sndbuff and recbuff by default.
Reference: http://erlang.org/doc/man/inet.html
(opens new window).
listener.tcp.external.tune_buffer
| Type | Optional Value | Default |
|---|---|---|
| enum | on, off |
- |
Description
If this configuration is enabled, please set the value equal to the maximum value of sndbuff and recbuff.
listener.tcp.external.nodelay
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
This is the TCP_NODELAY parameter. Enabling this option allows small TCP data packets to be sent immediately.
listener.tcp.external.reuseaddr
| Type | Optional Value | Default |
|---|---|---|
| enum | true, false |
true |
Description
This is the SO_REUSEADDR parameter. Enabling this option allows the local port to be reused without waiting for the end of the TIME_WAIT state.
listener.tcp.internal
| Type | Default |
|---|---|
| string | 127.0.0.1:11883 |
Description
Configure the listening address of the MQTT / TCP listener named internal.
Example
11883: listen to 0.0.0.0: 11883 of IPv4. 127.0.0.1:11883: listening address is11883 port on the 127.0.0.1 network card. :: 1: 11883: listen to the 11883 port on the :: 1 network card of IPv6 address.
listener.tcp.internal.acceptors
| Type | Default |
|---|---|
| integer | 4 |
Description
The size of the listener’s receiving pool.
listener.tcp.internal.max_connections
| Type | Default |
|---|---|
| integer | 1024000 |
Description
The maximum number of concurrent connections allowed by the listener.
listener.tcp.internal.max_conn_rate
| Type | Default |
|---|---|
| integer | 1000 |
Description
The maximum access rate allowed by the listener. Unit: pcs / sec
listener.tcp.internal.active_n
| Type | Default |
|---|---|
| integer | 1000 |
Description
The number of times the listener continues to receive TCP packets.
listener.tcp.internal.zone
| Type | Default |
|---|---|
| string | internal |
Description
The configuration zone to which the listener belongs.
listener.tcp.internal.rate_limit
| Type | Default |
|---|---|
| string | - |
Description
The rate limit of the listener. The format is <limit>,<duration>.
Example
100KB,10s:Limit the number of incoming bytes within 10 seconds no tot exceed 100 KB.
listener.tcp.internal.backlog
| Type | Default |
|---|---|
| integer | 512 |
Description
The maximum length of the TCP connection queue. It indicates the maximum number of TCP connection queues that are allowed in the system to undergo three-time handshake.
listener.tcp.internal.send_timeout
| Type | Default |
|---|---|
| duration | 5s |
Description
Timeout for sending TCP packets.
(本文超出站点单文档体积上限,已按小节截断)
