|
|
@@ -1,266 +0,0 @@
|
|
|
-%%===================================================================
|
|
|
-%%
|
|
|
-%% Config file for emqttd 2.0
|
|
|
-%%
|
|
|
-%% Erlang Term Syntax:
|
|
|
-%%
|
|
|
-%% {}: Tuple, usually {Key, Value}
|
|
|
-%% []: List, seperated by comma
|
|
|
-%% %%: Comment
|
|
|
-%%
|
|
|
-%%===================================================================
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% MQTT Protocol
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Max ClientId Length Allowed.
|
|
|
-{mqtt_max_clientid_len, 512}.
|
|
|
-
|
|
|
-%% Max Packet Size Allowed, 64K by default.
|
|
|
-{mqtt_max_packet_size, 65536}.
|
|
|
-
|
|
|
-%% Client Idle Timeout.
|
|
|
-{mqtt_client_idle_timeout, 30}. % Second
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Authentication
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Anonymous: Allow all
|
|
|
-{auth, anonymous, []}.
|
|
|
-
|
|
|
-%% Authentication with username, password
|
|
|
-{auth, username, [{passwd, "etc/passwd.conf"}]}.
|
|
|
-
|
|
|
-%% Authentication with clientId
|
|
|
-{auth, clientid, [{config, "etc/client.conf"}, {password, no}]}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% ACL
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-{acl, anonymous, []}.
|
|
|
-
|
|
|
-{acl, internal, [{config, "etc/acl.conf"}, {nomatch, allow}]}.
|
|
|
-
|
|
|
-%% Cache ACL result for PUBLISH
|
|
|
-{cache_acl, true}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Broker
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% System interval of publishing broker $SYS messages
|
|
|
-{broker_sys_interval, 60}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Retained message
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Expired after seconds, never expired if 0
|
|
|
-{retained_expired_after, 0}.
|
|
|
-
|
|
|
-%% Max number of retained messages
|
|
|
-{retained_max_message_num, 100000}.
|
|
|
-
|
|
|
-%% Max Payload Size of retained message
|
|
|
-{retained_max_playload_size, 65536}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Session
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Max number of QoS 1 and 2 messages that can be “inflight” at one time.
|
|
|
-%% 0 means no limit
|
|
|
-{session_max_inflight, 100}.
|
|
|
-
|
|
|
-%% Retry interval for redelivering QoS1/2 messages.
|
|
|
-{session_unack_retry_interval, 60}.
|
|
|
-
|
|
|
-%% Awaiting PUBREL Timeout
|
|
|
-{session_await_rel_timeout, 20}.
|
|
|
-
|
|
|
-%% Max Packets that Awaiting PUBREL, 0 means no limit
|
|
|
-{session_max_awaiting_rel, 0}.
|
|
|
-
|
|
|
-%% Statistics Collection Interval(seconds)
|
|
|
-{session_collect_interval, 0}.
|
|
|
-
|
|
|
-%% Expired after 2 day (unit: minute)
|
|
|
-{session_expired_after, 2880}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Queue
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Type: simple | priority
|
|
|
-{queue_type, simple}.
|
|
|
-
|
|
|
-%% Topic Priority: 0~255, Default is 0
|
|
|
-%% {queue_priority, [{"topic/1", 10}, {"topic/2", 8}]}.
|
|
|
-
|
|
|
-%% Max queue length. Enqueued messages when persistent client disconnected,
|
|
|
-%% or inflight window is full.
|
|
|
-{queue_max_length, infinity}.
|
|
|
-
|
|
|
-%% Low-water mark of queued messages
|
|
|
-{queue_low_watermark, 0.2}.
|
|
|
-
|
|
|
-%% High-water mark of queued messages
|
|
|
-{queue_high_watermark, 0.6}.
|
|
|
-
|
|
|
-%% Queue Qos0 messages?
|
|
|
-{queue_qos0, true}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Zone
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-{zone, admin, []}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Listener
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Plain MQTT
|
|
|
-{listener, mqtt, 1883, [
|
|
|
- %% Size of acceptor pool
|
|
|
- {acceptors, 16},
|
|
|
-
|
|
|
- %% Maximum number of concurrent clients
|
|
|
- {max_clients, 512},
|
|
|
-
|
|
|
- %% Mount point prefix
|
|
|
- %% {mount_point, "prefix/"},
|
|
|
-
|
|
|
- %% Socket Access Control
|
|
|
- {access, [{allow, all}]},
|
|
|
-
|
|
|
- %% Connection Options
|
|
|
- {connopts, [
|
|
|
- %% Rate Limit. Format is 'burst, rate', Unit is KB/Sec
|
|
|
- %% {rate_limit, "100,10"} %% 100K burst, 10K rate
|
|
|
- ]},
|
|
|
-
|
|
|
- %% Socket Options
|
|
|
- {sockopts, [
|
|
|
- %Set buffer if hight thoughtput
|
|
|
- %{recbuf, 4096},
|
|
|
- %{sndbuf, 4096},
|
|
|
- %{buffer, 4096},
|
|
|
- %{nodelay, true},
|
|
|
- {backlog, 1024}
|
|
|
- ]}
|
|
|
-]}.
|
|
|
-
|
|
|
-%% MQTT/SSL
|
|
|
-{listener, mqtts, 8883, [
|
|
|
- %% Size of acceptor pool
|
|
|
- {acceptors, 4},
|
|
|
-
|
|
|
- %% Maximum number of concurrent clients
|
|
|
- {max_clients, 512},
|
|
|
-
|
|
|
- %% Socket Access Control
|
|
|
- {access, [{allow, all}]},
|
|
|
-
|
|
|
- %% SSL certificate and key files
|
|
|
- {ssl, [{certfile, "etc/ssl/ssl.crt"},
|
|
|
- {keyfile, "etc/ssl/ssl.key"}]},
|
|
|
-
|
|
|
- %% Socket Options
|
|
|
- {sockopts, [
|
|
|
- {backlog, 1024}
|
|
|
- %{buffer, 4096},
|
|
|
- ]}
|
|
|
-]}.
|
|
|
-
|
|
|
-%% HTTP and WebSocket Listener
|
|
|
-{listener, http, 8083, [
|
|
|
- %% Size of acceptor pool
|
|
|
- {acceptors, 4},
|
|
|
-
|
|
|
- %% Maximum number of concurrent clients
|
|
|
- {max_clients, 64},
|
|
|
-
|
|
|
- %% Socket Access Control
|
|
|
- {access, [{allow, all}]},
|
|
|
-
|
|
|
- %% Socket Options
|
|
|
- {sockopts, [
|
|
|
- {backlog, 1024}
|
|
|
- %{buffer, 4096},
|
|
|
- ]}
|
|
|
-]}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% PubSub
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% PubSub and Router. Default should be scheduler numbers.
|
|
|
-{pubsub_pool_size, 8}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Routing
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Route aging time(seconds)
|
|
|
-{routing_age, 5}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Bridge
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% TODO: Bridge Queue Size
|
|
|
-{bridge_max_queue_len, 10000}.
|
|
|
-
|
|
|
-%% Ping Interval of bridge node
|
|
|
-{bridge_ping_down_interval, 1}. % second
|
|
|
-
|
|
|
-%%-------------------------------------------------------------------
|
|
|
-%% Plugins
|
|
|
-%%-------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Dir of plugins' config
|
|
|
-{plugins_etc_dir, "etc/plugins/"}.
|
|
|
-
|
|
|
-%% File to store loaded plugin names.
|
|
|
-{plugins_loaded_file, "data/loaded_plugins"}.
|
|
|
-
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-%% Modules
|
|
|
-%%--------------------------------------------------------------------
|
|
|
-
|
|
|
-%% Client presence management module. Publish presence messages when
|
|
|
-%% client connected or disconnected.
|
|
|
-{module, presence, [{qos, 0}]}.
|
|
|
-
|
|
|
-%% Subscribe topics automatically when client connected
|
|
|
-{module, subscription, [{"$queue/clients/$c", 1}, backend]}.
|
|
|
-
|
|
|
-%% [Rewrite](https://github.com/emqtt/emqttd/wiki/Rewrite)
|
|
|
-{module, rewrite, [{config, "etc/rewrite.conf"}]}.
|
|
|
-
|
|
|
-%%-------------------------------------------------------------------
|
|
|
-%% Erlang 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.
|
|
|
-%% 8 * 1024 * 1024
|
|
|
-{sysmon_large_heap, 8388608}.
|
|
|
-
|
|
|
-%% Busy Port
|
|
|
-{sysmon_busy_port, false}.
|
|
|
-
|
|
|
-%% Busy Dist Port
|
|
|
-{sysmon_busy_dist_port, true}.
|
|
|
-
|