283 lines
7.5 KiB
Plaintext
283 lines
7.5 KiB
Plaintext
##--------------------------------------------------------------------
|
|
## 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
|
|
|
|
## 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 = log/crash.dump
|
|
|
|
## Distributed node ticktime
|
|
node.dist_net_ticktime = 60
|
|
|
|
## Distributed node port range
|
|
## node.dist_listen_min = 6000
|
|
## node.dist_listen_max = 6999
|
|
|
|
##--------------------------------------------------------------------
|
|
## Log
|
|
##--------------------------------------------------------------------
|
|
|
|
## Console log. Enum: off, file, console, both
|
|
log.console = console
|
|
|
|
## Console log level. Enum: debug, info, notice, warning, error, critical, alert, emergency
|
|
log.console.level = error
|
|
|
|
## Console log file
|
|
## log.console.file = log/console.log
|
|
|
|
## Error log file
|
|
log.error.file = log/error.log
|
|
|
|
## Enable the crash log. Enum: on, off
|
|
log.crash = on
|
|
|
|
log.crash.file = log/crash.log
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Protocol
|
|
##--------------------------------------------------------------------
|
|
|
|
## Max ClientId Length Allowed.
|
|
mqtt.max_clientid_len = 1024
|
|
|
|
## Max Packet Size Allowed, 64K by default.
|
|
mqtt.max_packet_size = 64KB
|
|
|
|
## Client Idle Timeout (Second)
|
|
mqtt.client_idle_timeout = 30
|
|
|
|
## Allow Anonymous authentication
|
|
mqtt.allow_anonymous = true
|
|
|
|
## Default ACL File
|
|
mqtt.acl_file = etc/acl.conf
|
|
|
|
##--------------------------------------------------------------------
|
|
## MQTT Session
|
|
##--------------------------------------------------------------------
|
|
|
|
## Max number of QoS 1 and 2 messages that can be “inflight” at one time.
|
|
## 0 means no limit
|
|
mqtt.session.max_inflight = 100
|
|
|
|
## Retry interval for redelivering QoS1/2 messages.
|
|
mqtt.session.retry_interval = 60
|
|
|
|
## Awaiting PUBREL Timeout
|
|
mqtt.session.await_rel_timeout = 20
|
|
|
|
## Max Packets that Awaiting PUBREL, 0 means no limit
|
|
mqtt.session.max_awaiting_rel = 0
|
|
|
|
## Statistics Collection Interval(seconds)
|
|
mqtt.session.collect_interval = 0
|
|
|
|
## Expired after 1 day:
|
|
## w - week
|
|
## d - day
|
|
## h - hour
|
|
## m - minute
|
|
## s - second
|
|
mqtt.session.expired_after = 1d
|
|
|
|
##--------------------------------------------------------------------
|
|
## 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 = etc/plugins/
|
|
|
|
## File to store loaded plugin names.
|
|
mqtt.plugins.loaded_file = data/loaded_plugins
|
|
|
|
##-------------------------------------------------------------------
|
|
## MQTT Modules
|
|
##-------------------------------------------------------------------
|
|
|
|
## Enable retainer module
|
|
mqtt.module.retainer = on
|
|
|
|
## disc: disc_copies, ram: ram_copies
|
|
mqtt.module.retainer.storage_type = ram
|
|
|
|
## Max number of retained messages
|
|
mqtt.module.retainer.max_message_num = 100000
|
|
|
|
## Max Payload Size of retained message
|
|
mqtt.module.retainer.max_payload_size = 64KB
|
|
|
|
## Expired after seconds, never expired if 0
|
|
mqtt.module.retainer.expired_after = 0
|
|
|
|
## Enable presence module
|
|
## Publish presence messages when client connected or disconnected.
|
|
mqtt.module.presence = on
|
|
|
|
mqtt.module.presence.qos = 0
|
|
|
|
## Enable subscription module
|
|
## Subscribe topics automatically when client connected
|
|
mqtt.module.subscription = on
|
|
|
|
mqtt.module.subscription.topics = $client/%c=1,$user/%u=1
|
|
|
|
##--------------------------------------------------------------------
|
|
## 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
|
|
mqtt.listener.ssl.handshake_timeout = 15
|
|
mqtt.listener.ssl.keyfile = etc/certs/key.pem
|
|
mqtt.listener.ssl.certfile = etc/certs/cert.pem
|
|
mqtt.listener.ssl.cacertfile = etc/certs/cacert.pem
|
|
## mqtt.listener.ssl.verify = verify_peer
|
|
## mqtt.listener.ssl.failed_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 = 10
|
|
## mqtt.listener.https.certfile = etc/certs/cert.pem
|
|
## mqtt.listener.https.keyfile = etc/certs/key.pem
|
|
## mqtt.listener.https.cacertfile = etc/certs/cacert.pem
|
|
## mqtt.listener.https.verify = verify_peer
|
|
## mqtt.listener.https.failed_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
|
|
|