297 lines
8.2 KiB
Plaintext
297 lines
8.2 KiB
Plaintext
|
|
##===================================================================
|
|
## EMQ Configuration R2.1
|
|
##===================================================================
|
|
|
|
##--------------------------------------------------------------------
|
|
## Node Args
|
|
##--------------------------------------------------------------------
|
|
|
|
## Node name
|
|
node.name = emqttd@127.0.0.1
|
|
|
|
## Cookie for distributed node
|
|
node.cookie = emq_dist_cookie
|
|
|
|
## SMP support: enable, auto, disable
|
|
node.smp = auto
|
|
|
|
## vm.args: -heart
|
|
## Heartbeat monitoring of an Erlang runtime system
|
|
## Value should be 'on' or comment the line
|
|
## node.heartbeat = on
|
|
|
|
## Enable kernel poll
|
|
node.kernel_poll = on
|
|
|
|
## async thread pool
|
|
node.async_threads = 32
|
|
|
|
## Erlang Process Limit
|
|
node.process_limit = 256000
|
|
|
|
## Sets the maximum number of simultaneously existing ports for this system
|
|
node.max_ports = 65536
|
|
|
|
## Set the distribution buffer busy limit (dist_buf_busy_limit)
|
|
node.dist_buffer_size = 32MB
|
|
|
|
## Max ETS Tables.
|
|
## Note that mnesia and SSL will create temporary ets tables.
|
|
node.max_ets_tables = 256000
|
|
|
|
## Tweak GC to run more often
|
|
node.fullsweep_after = 1000
|
|
|
|
## Crash dump
|
|
node.crash_dump = {{ platform_log_dir }}/crash.dump
|
|
|
|
## Distributed node ticktime
|
|
node.dist_net_ticktime = 60
|
|
|
|
## Distributed node port range
|
|
## node.dist_listen_min = 6369
|
|
## node.dist_listen_max = 6369
|
|
|
|
##--------------------------------------------------------------------
|
|
## Log
|
|
##--------------------------------------------------------------------
|
|
|
|
## Set the log dir
|
|
log.dir = {{ platform_log_dir }}
|
|
|
|
## Console log. Enum: off, file, console, both
|
|
log.console = console
|
|
|
|
## Syslog. Enum: on, off
|
|
log.syslog = on
|
|
|
|
## syslog level. Enum: debug, info, notice, warning, error, critical, alert, emergency
|
|
log.syslog.level = error
|
|
|
|
## Console log level. Enum: debug, info, notice, warning, error, critical, alert, emergency
|
|
log.console.level = error
|
|
|
|
## Console log file
|
|
## log.console.file = {{ platform_log_dir }}/console.log
|
|
|
|
## Error log file
|
|
log.error.file = {{ platform_log_dir }}/error.log
|
|
|
|
## Enable the crash log. Enum: on, off
|
|
log.crash = on
|
|
|
|
log.crash.file = {{ platform_log_dir }}/crash.log
|
|
|
|
##--------------------------------------------------------------------
|
|
## Allow Anonymous and Default ACL
|
|
##--------------------------------------------------------------------
|
|
|
|
## Allow Anonymous authentication
|
|
mqtt.allow_anonymous = true
|
|
|
|
## Default ACL File
|
|
mqtt.acl_file = {{ platform_etc_dir }}/acl.conf
|
|
|
|
## Cache ACL for PUBLISH
|
|
mqtt.cache_acl = true
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Protocol
|
|
##--------------------------------------------------------------------
|
|
|
|
## Max ClientId Length Allowed.
|
|
mqtt.max_clientid_len = 1024
|
|
|
|
## Max Packet Size Allowed, 64K by default.
|
|
mqtt.max_packet_size = 64KB
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Connection
|
|
##--------------------------------------------------------------------
|
|
|
|
## Force GC: integer. Value 0 disabled the Force GC.
|
|
mqtt.conn.force_gc_count = 100
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Client
|
|
##--------------------------------------------------------------------
|
|
|
|
## Client Idle Timeout (Second)
|
|
mqtt.client.idle_timeout = 30s
|
|
|
|
## Enable client Stats: on | off
|
|
mqtt.client.enable_stats = off
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Session
|
|
##--------------------------------------------------------------------
|
|
|
|
## Upgrade QoS?
|
|
mqtt.session.upgrade_qos = off
|
|
|
|
## Max number of QoS 1 and 2 messages that can be “inflight” at one time.
|
|
## 0 means no limit
|
|
mqtt.session.max_inflight = 32
|
|
|
|
## Retry Interval for redelivering QoS1/2 messages.
|
|
mqtt.session.retry_interval = 20s
|
|
|
|
## Max Packets that Awaiting PUBREL, 0 means no limit
|
|
mqtt.session.max_awaiting_rel = 100
|
|
|
|
## Awaiting PUBREL Timeout
|
|
mqtt.session.await_rel_timeout = 20s
|
|
|
|
## Enable Statistics: on | off
|
|
mqtt.session.enable_stats = off
|
|
|
|
## Expired after 1 day:
|
|
## w - week
|
|
## d - day
|
|
## h - hour
|
|
## m - minute
|
|
## s - second
|
|
mqtt.session.expiry_interval = 2h
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Queue
|
|
##--------------------------------------------------------------------
|
|
|
|
## Type: simple | priority
|
|
mqtt.queue.type = simple
|
|
|
|
## Topic Priority: 0~255, Default is 0
|
|
## mqtt.queue.priority = topic/1=10,topic/2=8
|
|
|
|
## Max queue length. Enqueued messages when persistent client disconnected,
|
|
## or inflight window is full.
|
|
mqtt.queue.max_length = infinity
|
|
|
|
## Low-water mark of queued messages
|
|
mqtt.queue.low_watermark = 20%
|
|
|
|
## High-water mark of queued messages
|
|
mqtt.queue.high_watermark = 60%
|
|
|
|
## Queue Qos0 messages?
|
|
mqtt.queue.qos0 = true
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Broker and PubSub
|
|
##--------------------------------------------------------------------
|
|
|
|
## System Interval of publishing broker $SYS Messages
|
|
mqtt.broker.sys_interval = 60
|
|
|
|
## PubSub Pool Size. Default should be scheduler numbers.
|
|
mqtt.pubsub.pool_size = 8
|
|
|
|
mqtt.pubsub.by_clientid = true
|
|
|
|
## Subscribe Asynchronously
|
|
mqtt.pubsub.async = true
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Bridge
|
|
##--------------------------------------------------------------------
|
|
|
|
## Bridge Queue Size
|
|
mqtt.bridge.max_queue_len = 10000
|
|
|
|
## Ping Interval of bridge node. Unit: Second
|
|
mqtt.bridge.ping_down_interval = 1
|
|
|
|
##-------------------------------------------------------------------
|
|
## MQTT Plugins
|
|
##-------------------------------------------------------------------
|
|
|
|
## Dir of plugins' config
|
|
mqtt.plugins.etc_dir ={{ platform_etc_dir }}/plugins/
|
|
|
|
## File to store loaded plugin names.
|
|
mqtt.plugins.loaded_file = {{ platform_data_dir }}/loaded_plugins
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Listeners
|
|
##--------------------------------------------------------------------
|
|
|
|
## TCP Listener: 1883, 127.0.0.1:1883, ::1:1883
|
|
mqtt.listener.tcp = 1883
|
|
|
|
## Size of acceptor pool
|
|
mqtt.listener.tcp.acceptors = 8
|
|
|
|
## Maximum number of concurrent clients
|
|
mqtt.listener.tcp.max_clients = 1024
|
|
|
|
## Rate Limit. Format is 'burst,rate', Unit is KB/Sec
|
|
## mqtt.listener.tcp.rate_limit = 100,10
|
|
|
|
## TCP Socket Options
|
|
mqtt.listener.tcp.backlog = 1024
|
|
## mqtt.listener.tcp.recbuf = 4096
|
|
## mqtt.listener.tcp.sndbuf = 4096
|
|
## mqtt.listener.tcp.buffer = 4096
|
|
## mqtt.listener.tcp.nodelay = true
|
|
|
|
## SSL Listener: 8883, 127.0.0.1:8883, ::1:8883
|
|
mqtt.listener.ssl = 8883
|
|
|
|
## Size of acceptor pool
|
|
mqtt.listener.ssl.acceptors = 4
|
|
|
|
## Maximum number of concurrent clients
|
|
mqtt.listener.ssl.max_clients = 512
|
|
|
|
## Rate Limit. Format is 'burst,rate', Unit is KB/Sec
|
|
## mqtt.listener.ssl.rate_limit = 100,10
|
|
|
|
## Configuring SSL Options. See http://erlang.org/doc/man/ssl.html
|
|
### TLS only for POODLE attack
|
|
mqtt.listener.ssl.tls_versions = tlsv1.2,tlsv1.1,tlsv1
|
|
mqtt.listener.ssl.handshake_timeout = 15s
|
|
mqtt.listener.ssl.keyfile = {{ platform_etc_dir }}/certs/key.pem
|
|
mqtt.listener.ssl.certfile = {{ platform_etc_dir }}/certs/cert.pem
|
|
## mqtt.listener.ssl.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem
|
|
## mqtt.listener.ssl.verify = verify_peer
|
|
## mqtt.listener.ssl.fail_if_no_peer_cert = true
|
|
|
|
## HTTP and WebSocket Listener
|
|
mqtt.listener.http = 8083
|
|
mqtt.listener.http.acceptors = 4
|
|
mqtt.listener.http.max_clients = 64
|
|
|
|
## HTTP(SSL) Listener
|
|
mqtt.listener.https = 8084
|
|
mqtt.listener.https.acceptors = 4
|
|
mqtt.listener.https.max_clients = 64
|
|
mqtt.listener.https.handshake_timeout = 15
|
|
mqtt.listener.https.keyfile = {{ platform_etc_dir }}/certs/key.pem
|
|
mqtt.listener.https.certfile = {{ platform_etc_dir }}/certs/cert.pem
|
|
## mqtt.listener.https.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem
|
|
|
|
## mqtt.listener.https.verify = verify_peer
|
|
## mqtt.listener.https.fail_if_no_peer_cert = true
|
|
|
|
##-------------------------------------------------------------------
|
|
## System Monitor
|
|
##-------------------------------------------------------------------
|
|
|
|
## Long GC, don't monitor in production mode for:
|
|
## https://github.com/erlang/otp/blob/feb45017da36be78d4c5784d758ede619fa7bfd3/erts/emulator/beam/erl_gc.c#L421
|
|
sysmon.long_gc = false
|
|
|
|
## Long Schedule(ms)
|
|
sysmon.long_schedule = 240
|
|
|
|
## 8M words. 32MB on 32-bit VM, 64MB on 64-bit VM.
|
|
sysmon.large_heap = 8MB
|
|
|
|
## Busy Port
|
|
sysmon.busy_port = false
|
|
|
|
## Busy Dist Port
|
|
sysmon.busy_dist_port = true
|
|
|