commit
a0bec0d921
|
@ -218,7 +218,7 @@ jobs:
|
||||||
- emqx
|
- emqx
|
||||||
- emqx-enterprise
|
- emqx-enterprise
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
container: "ghcr.io/iequ1/emqx-schema-validate:0.2.1"
|
container: "ghcr.io/iequ1/emqx-schema-validate:0.2.2"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
name: Download schema dump
|
name: Download schema dump
|
||||||
|
|
|
@ -1014,9 +1014,9 @@ broker {
|
||||||
## @doc broker.session_locking_strategy
|
## @doc broker.session_locking_strategy
|
||||||
## ValueType: local | one | quorum | all
|
## ValueType: local | one | quorum | all
|
||||||
## - local: only lock the session locally on the current node
|
## - local: only lock the session locally on the current node
|
||||||
## - one: select only one remove node to lock the session
|
## - one: select only one remote node to lock the session
|
||||||
## - quorum: select some nodes to lock the session
|
## - quorum: select some nodes to lock the session
|
||||||
## - all: lock the session on all of the nodes in the cluster
|
## - all: lock the session on all the nodes in the cluster
|
||||||
## Default: quorum
|
## Default: quorum
|
||||||
session_locking_strategy = quorum
|
session_locking_strategy = quorum
|
||||||
|
|
||||||
|
@ -1027,7 +1027,7 @@ broker {
|
||||||
## - random: dispatch the message to a random selected subscriber
|
## - random: dispatch the message to a random selected subscriber
|
||||||
## - round_robin: select the subscribers in a round-robin manner
|
## - round_robin: select the subscribers in a round-robin manner
|
||||||
## - sticky: always use the last selected subscriber to dispatch,
|
## - sticky: always use the last selected subscriber to dispatch,
|
||||||
## until the susbcriber disconnected.
|
## until the subscriber disconnects.
|
||||||
## - hash: select the subscribers by the hash of clientIds
|
## - hash: select the subscribers by the hash of clientIds
|
||||||
## Default: round_robin
|
## Default: round_robin
|
||||||
shared_subscription_strategy = round_robin
|
shared_subscription_strategy = round_robin
|
||||||
|
@ -1158,7 +1158,7 @@ sysmon {
|
||||||
## Default: disabled
|
## Default: disabled
|
||||||
vm.long_gc = disabled
|
vm.long_gc = disabled
|
||||||
|
|
||||||
## Enable Long Schedule(ms) monitoring.
|
## Enable Long Schedule monitoring.
|
||||||
##
|
##
|
||||||
## See: http://erlang.org/doc/man/erlang.html#system_monitor-2
|
## See: http://erlang.org/doc/man/erlang.html#system_monitor-2
|
||||||
##
|
##
|
||||||
|
|
|
@ -107,8 +107,8 @@ fields(limiter_opts) ->
|
||||||
[ {rate, sc(rate(), #{default => "infinity", desc => "The rate"})}
|
[ {rate, sc(rate(), #{default => "infinity", desc => "The rate"})}
|
||||||
, {burst, sc(burst_rate(),
|
, {burst, sc(burst_rate(),
|
||||||
#{default => "0/0s",
|
#{default => "0/0s",
|
||||||
desc => "The burst, This value is based on rate."
|
desc => "The burst, This value is based on rate.<br/>
|
||||||
" This value + rate = the maximum limit that can be achieved when limiter burst"
|
This value + rate = the maximum limit that can be achieved when limiter burst."
|
||||||
})}
|
})}
|
||||||
, {bucket, sc(map("bucket name", ref(bucket_opts)), #{desc => "Buckets config"})}
|
, {bucket, sc(map("bucket name", ref(bucket_opts)), #{desc => "Buckets config"})}
|
||||||
];
|
];
|
||||||
|
@ -121,7 +121,7 @@ fields(bucket_opts) ->
|
||||||
, {per_client, sc(ref(client_bucket),
|
, {per_client, sc(ref(client_bucket),
|
||||||
#{default => #{},
|
#{default => #{},
|
||||||
desc => "The rate limit for each user of the bucket,"
|
desc => "The rate limit for each user of the bucket,"
|
||||||
"this field is not required"
|
" this field is not required"
|
||||||
})}
|
})}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -905,7 +905,12 @@ fields("ws_opts") ->
|
||||||
{"mqtt_path",
|
{"mqtt_path",
|
||||||
sc(
|
sc(
|
||||||
string(),
|
string(),
|
||||||
#{default => "/mqtt"}
|
#{
|
||||||
|
default => "/mqtt",
|
||||||
|
desc =>
|
||||||
|
"WebSocket's MQTT protocol path. So the address of\n"
|
||||||
|
" EMQX Broker's WebSocket is: <code>ws://{ip}:{port}/mqtt</code>"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"mqtt_piggyback",
|
{"mqtt_piggyback",
|
||||||
sc(
|
sc(
|
||||||
|
@ -915,52 +920,99 @@ fields("ws_opts") ->
|
||||||
{"compress",
|
{"compress",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => false}
|
#{
|
||||||
|
default => false,
|
||||||
|
desc =>
|
||||||
|
"If <code>true</code>, compress WebSocket messages using <code>zlib</code>.<br/>\n"
|
||||||
|
" The configuration items under <code>deflate_opts</code> belong to the compression-related parameter configuration."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"idle_timeout",
|
{"idle_timeout",
|
||||||
sc(
|
sc(
|
||||||
duration(),
|
duration(),
|
||||||
#{default => "15s"}
|
#{
|
||||||
|
default => "15s",
|
||||||
|
desc =>
|
||||||
|
"The idle time after the TCP connection is established <br/>\n"
|
||||||
|
" If no packets are received within this time, the connection will be closed."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"max_frame_size",
|
{"max_frame_size",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([infinity, integer()]),
|
hoconsc:union([infinity, integer()]),
|
||||||
#{default => infinity}
|
#{
|
||||||
|
default => infinity,
|
||||||
|
desc => "The maximum length of a single MQTT packet."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"fail_if_no_subprotocol",
|
{"fail_if_no_subprotocol",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc =>
|
||||||
|
"If <code>true</code>, the server will return an error when\n"
|
||||||
|
" the client does not carry the <code>Sec-WebSocket-Protocol</code> field.\n"
|
||||||
|
" <br/>Note: WeChat applet needs to disable this verification."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"supported_subprotocols",
|
{"supported_subprotocols",
|
||||||
sc(
|
sc(
|
||||||
comma_separated_list(),
|
comma_separated_list(),
|
||||||
#{default => "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5"}
|
#{
|
||||||
|
default => "mqtt, mqtt-v3, mqtt-v3.1.1, mqtt-v5",
|
||||||
|
desc => "Comma-separated list of supported subprotocols."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"check_origin_enable",
|
{"check_origin_enable",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => false}
|
#{
|
||||||
|
default => false,
|
||||||
|
desc =>
|
||||||
|
"If <code>true</code>, <code>origin</code> HTTP header will be\n"
|
||||||
|
" validated against the list of allowed origins configured in <code>check_origins</code>\n"
|
||||||
|
" parameter."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"allow_origin_absence",
|
{"allow_origin_absence",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc =>
|
||||||
|
"If <code>false</code> and <code>check_origin_enable</code> is\n"
|
||||||
|
" <code>true</code>, the server will reject requests that don't have <code>origin</code>\n"
|
||||||
|
" HTTP header."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"check_origins",
|
{"check_origins",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:array(binary()),
|
hoconsc:array(binary()),
|
||||||
#{default => []}
|
#{
|
||||||
|
default => [],
|
||||||
|
desc => "List of allowed origins.<br/>See <code>check_origin_enable</code>."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"proxy_address_header",
|
{"proxy_address_header",
|
||||||
sc(
|
sc(
|
||||||
string(),
|
string(),
|
||||||
#{default => "x-forwarded-for"}
|
#{
|
||||||
|
default => "x-forwarded-for",
|
||||||
|
desc =>
|
||||||
|
"HTTP header used to pass information about the client IP address.\n"
|
||||||
|
" Relevant when the EMQX cluster is deployed behind a load-balancer."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"proxy_port_header",
|
{"proxy_port_header",
|
||||||
sc(
|
sc(
|
||||||
string(),
|
string(),
|
||||||
#{default => "x-forwarded-port"}
|
#{
|
||||||
|
default => "x-forwarded-port",
|
||||||
|
desc =>
|
||||||
|
"HTTP header used to pass information about the client port.\n"
|
||||||
|
" Relevant when the EMQX cluster is deployed behind a load-balancer."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"deflate_opts",
|
{"deflate_opts",
|
||||||
sc(
|
sc(
|
||||||
|
@ -973,52 +1025,79 @@ fields("tcp_opts") ->
|
||||||
{"active_n",
|
{"active_n",
|
||||||
sc(
|
sc(
|
||||||
integer(),
|
integer(),
|
||||||
#{default => 100}
|
#{
|
||||||
|
default => 100,
|
||||||
|
desc =>
|
||||||
|
"Specify the {active, N} option for this Socket.<br/>\n"
|
||||||
|
" See: https://erlang.org/doc/man/inet.html#setopts-2"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"backlog",
|
{"backlog",
|
||||||
sc(
|
sc(
|
||||||
integer(),
|
integer(),
|
||||||
#{default => 1024}
|
#{
|
||||||
|
default => 1024,
|
||||||
|
desc =>
|
||||||
|
"TCP backlog defines the maximum length that the queue of\n"
|
||||||
|
" pending connections can grow to."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"send_timeout",
|
{"send_timeout",
|
||||||
sc(
|
sc(
|
||||||
duration(),
|
duration(),
|
||||||
#{default => "15s"}
|
#{
|
||||||
|
default => "15s",
|
||||||
|
desc => "The TCP send timeout for the connections."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"send_timeout_close",
|
{"send_timeout_close",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc => "Close the connection if send timeout."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"recbuf",
|
{"recbuf",
|
||||||
sc(
|
sc(
|
||||||
bytesize(),
|
bytesize(),
|
||||||
#{}
|
#{desc => "The TCP receive buffer (OS kernel) for the connections."}
|
||||||
)},
|
)},
|
||||||
{"sndbuf",
|
{"sndbuf",
|
||||||
sc(
|
sc(
|
||||||
bytesize(),
|
bytesize(),
|
||||||
#{}
|
#{desc => "The TCP send buffer (OS kernel) for the connections."}
|
||||||
)},
|
)},
|
||||||
{"buffer",
|
{"buffer",
|
||||||
sc(
|
sc(
|
||||||
bytesize(),
|
bytesize(),
|
||||||
#{}
|
#{desc => "The size of the user-space buffer used by the driver."}
|
||||||
)},
|
)},
|
||||||
{"high_watermark",
|
{"high_watermark",
|
||||||
sc(
|
sc(
|
||||||
bytesize(),
|
bytesize(),
|
||||||
#{default => "1MB"}
|
#{
|
||||||
|
default => "1MB",
|
||||||
|
desc =>
|
||||||
|
"The socket is set to a busy state when the amount of data queued internally\n"
|
||||||
|
" by the VM socket implementation reaches this limit."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"nodelay",
|
{"nodelay",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => false}
|
#{
|
||||||
|
default => false,
|
||||||
|
desc => "The TCP_NODELAY flag for the connections."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"reuseaddr",
|
{"reuseaddr",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc => "The SO_REUSEADDR flag for the connections."
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
];
|
];
|
||||||
fields("listener_ssl_opts") ->
|
fields("listener_ssl_opts") ->
|
||||||
|
@ -1048,37 +1127,56 @@ fields("deflate_opts") ->
|
||||||
{"level",
|
{"level",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:enum([none, default, best_compression, best_speed]),
|
hoconsc:enum([none, default, best_compression, best_speed]),
|
||||||
#{}
|
#{desc => "Compression level."}
|
||||||
)},
|
)},
|
||||||
{"mem_level",
|
{"mem_level",
|
||||||
sc(
|
sc(
|
||||||
range(1, 9),
|
range(1, 9),
|
||||||
#{default => 8}
|
#{
|
||||||
|
default => 8,
|
||||||
|
desc =>
|
||||||
|
"Specifies the size of the compression state.<br/>\n"
|
||||||
|
" Lower values decrease memory usage per connection."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"strategy",
|
{"strategy",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:enum([default, filtered, huffman_only, rle]),
|
hoconsc:enum([default, filtered, huffman_only, rle]),
|
||||||
#{}
|
#{desc => "Specifies the compression strategy."}
|
||||||
)},
|
)},
|
||||||
{"server_context_takeover",
|
{"server_context_takeover",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:enum([takeover, no_takeover]),
|
hoconsc:enum([takeover, no_takeover]),
|
||||||
#{}
|
#{
|
||||||
|
desc =>
|
||||||
|
"Takeover means the compression state is retained\n"
|
||||||
|
" between server messages."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"client_context_takeover",
|
{"client_context_takeover",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:enum([takeover, no_takeover]),
|
hoconsc:enum([takeover, no_takeover]),
|
||||||
#{}
|
#{
|
||||||
|
desc =>
|
||||||
|
"Takeover means the compression state is retained\n"
|
||||||
|
" between client messages."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"server_max_window_bits",
|
{"server_max_window_bits",
|
||||||
sc(
|
sc(
|
||||||
range(8, 15),
|
range(8, 15),
|
||||||
#{default => 15}
|
#{
|
||||||
|
default => 15,
|
||||||
|
desc => "Specifies the size of the compression context for the server."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"client_max_window_bits",
|
{"client_max_window_bits",
|
||||||
sc(
|
sc(
|
||||||
range(8, 15),
|
range(8, 15),
|
||||||
#{default => 15}
|
#{
|
||||||
|
default => 15,
|
||||||
|
desc => "Specifies the size of the compression context for the client."
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
];
|
];
|
||||||
fields("broker") ->
|
fields("broker") ->
|
||||||
|
@ -1086,27 +1184,57 @@ fields("broker") ->
|
||||||
{"enable_session_registry",
|
{"enable_session_registry",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc => "Enable session registry"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"session_locking_strategy",
|
{"session_locking_strategy",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:enum([local, leader, quorum, all]),
|
hoconsc:enum([local, leader, quorum, all]),
|
||||||
#{default => quorum}
|
#{
|
||||||
|
default => quorum,
|
||||||
|
desc =>
|
||||||
|
"Session locking strategy in a cluster.<br/>\n"
|
||||||
|
" - `local`: only lock the session on the current node\n"
|
||||||
|
" - `one`: select only one remote node to lock the session\n"
|
||||||
|
" - `quorum`: select some nodes to lock the session\n"
|
||||||
|
" - `all`: lock the session on all the nodes in the cluster"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"shared_subscription_strategy",
|
{"shared_subscription_strategy",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:enum([random, round_robin, sticky, hash_topic, hash_clientid]),
|
hoconsc:enum([random, round_robin, sticky, hash_topic, hash_clientid]),
|
||||||
#{default => round_robin}
|
#{
|
||||||
|
default => round_robin,
|
||||||
|
desc =>
|
||||||
|
"Dispatch strategy for shared subscription.<br/>\n"
|
||||||
|
" - `random`: dispatch the message to a random selected subscriber\n"
|
||||||
|
" - `round_robin`: select the subscribers in a round-robin manner\n"
|
||||||
|
" - `sticky`: always use the last selected subscriber to dispatch,\n"
|
||||||
|
" until the subscriber disconnects.\n"
|
||||||
|
" - `hash`: select the subscribers by the hash of `clientIds`"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"shared_dispatch_ack_enabled",
|
{"shared_dispatch_ack_enabled",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => false}
|
#{
|
||||||
|
default => false,
|
||||||
|
desc =>
|
||||||
|
"Enable/disable shared dispatch acknowledgement for QoS1 and QoS2 messages.<br/>\n"
|
||||||
|
" This should allow messages to be dispatched to a different subscriber in\n"
|
||||||
|
" the group in case the picked (based on `shared_subscription_strategy`) subscriber\n"
|
||||||
|
" is offline."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"route_batch_clean",
|
{"route_batch_clean",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc => "Enable batch clean for deleted routes."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"perf",
|
{"perf",
|
||||||
sc(
|
sc(
|
||||||
|
@ -1215,42 +1343,74 @@ fields("sysmon_vm") ->
|
||||||
{"process_check_interval",
|
{"process_check_interval",
|
||||||
sc(
|
sc(
|
||||||
duration(),
|
duration(),
|
||||||
#{default => "30s"}
|
#{
|
||||||
|
default => "30s",
|
||||||
|
desc => "The time interval for the periodic process limit check."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"process_high_watermark",
|
{"process_high_watermark",
|
||||||
sc(
|
sc(
|
||||||
percent(),
|
percent(),
|
||||||
#{default => "80%"}
|
#{
|
||||||
|
default => "80%",
|
||||||
|
desc =>
|
||||||
|
"The threshold, as percentage of processes, for how many\n"
|
||||||
|
" processes can simultaneously exist at the local node before the corresponding\n"
|
||||||
|
" alarm is set."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"process_low_watermark",
|
{"process_low_watermark",
|
||||||
sc(
|
sc(
|
||||||
percent(),
|
percent(),
|
||||||
#{default => "60%"}
|
#{
|
||||||
|
default => "60%",
|
||||||
|
desc =>
|
||||||
|
"The threshold, as percentage of processes, for how many\n"
|
||||||
|
" processes can simultaneously exist at the local node before the corresponding\n"
|
||||||
|
" alarm is cleared."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"long_gc",
|
{"long_gc",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([disabled, duration()]),
|
hoconsc:union([disabled, duration()]),
|
||||||
#{}
|
#{
|
||||||
|
desc =>
|
||||||
|
"Enable Long GC monitoring.<br/>\n"
|
||||||
|
" Notice: don't enable the monitor in production for:<br/>\n"
|
||||||
|
" https://github.com/erlang/otp/blob/feb45017da36be78d4c5784d758ede619fa7bfd3/erts/emulator/beam/erl_gc.c#L421"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"long_schedule",
|
{"long_schedule",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([disabled, duration()]),
|
hoconsc:union([disabled, duration()]),
|
||||||
#{default => "240ms"}
|
#{
|
||||||
|
default => "240ms",
|
||||||
|
desc => "Enable Long Schedule monitoring."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"large_heap",
|
{"large_heap",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([disabled, bytesize()]),
|
hoconsc:union([disabled, bytesize()]),
|
||||||
#{default => "32MB"}
|
#{
|
||||||
|
default => "32MB",
|
||||||
|
desc => "Enable Large Heap monitoring."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"busy_dist_port",
|
{"busy_dist_port",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc => "Enable Busy Distribution Port monitoring."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"busy_port",
|
{"busy_port",
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{default => true}
|
#{
|
||||||
|
default => true,
|
||||||
|
desc => "Enable Busy Port monitoring."
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
];
|
];
|
||||||
fields("sysmon_os") ->
|
fields("sysmon_os") ->
|
||||||
|
@ -1258,32 +1418,59 @@ fields("sysmon_os") ->
|
||||||
{"cpu_check_interval",
|
{"cpu_check_interval",
|
||||||
sc(
|
sc(
|
||||||
duration(),
|
duration(),
|
||||||
#{default => "60s"}
|
#{
|
||||||
|
default => "60s",
|
||||||
|
desc => "The time interval for the periodic CPU check."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"cpu_high_watermark",
|
{"cpu_high_watermark",
|
||||||
sc(
|
sc(
|
||||||
percent(),
|
percent(),
|
||||||
#{default => "80%"}
|
#{
|
||||||
|
default => "80%",
|
||||||
|
desc =>
|
||||||
|
"The threshold, as percentage of system CPU load,\n"
|
||||||
|
" for how much system cpu can be used before the corresponding alarm is set."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"cpu_low_watermark",
|
{"cpu_low_watermark",
|
||||||
sc(
|
sc(
|
||||||
percent(),
|
percent(),
|
||||||
#{default => "60%"}
|
#{
|
||||||
|
default => "60%",
|
||||||
|
desc =>
|
||||||
|
"The threshold, as percentage of system CPU load,\n"
|
||||||
|
" for how much system cpu can be used before the corresponding alarm is cleared."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"mem_check_interval",
|
{"mem_check_interval",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([disabled, duration()]),
|
hoconsc:union([disabled, duration()]),
|
||||||
#{default => "60s"}
|
#{
|
||||||
|
default => "60s",
|
||||||
|
desc => "The time interval for the periodic memory check."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"sysmem_high_watermark",
|
{"sysmem_high_watermark",
|
||||||
sc(
|
sc(
|
||||||
percent(),
|
percent(),
|
||||||
#{default => "70%"}
|
#{
|
||||||
|
default => "70%",
|
||||||
|
desc =>
|
||||||
|
"The threshold, as percentage of system memory,\n"
|
||||||
|
" for how much system memory can be allocated before the corresponding alarm is set."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"procmem_high_watermark",
|
{"procmem_high_watermark",
|
||||||
sc(
|
sc(
|
||||||
percent(),
|
percent(),
|
||||||
#{default => "5%"}
|
#{
|
||||||
|
default => "5%",
|
||||||
|
desc =>
|
||||||
|
"The threshold, as percentage of system memory,\n"
|
||||||
|
" for how much system memory can be allocated by one Erlang process before\n"
|
||||||
|
" the corresponding alarm is set."
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
];
|
];
|
||||||
fields("sysmon_top") ->
|
fields("sysmon_top") ->
|
||||||
|
@ -1451,27 +1638,57 @@ base_listener() ->
|
||||||
{"bind",
|
{"bind",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([ip_port(), integer()]),
|
hoconsc:union([ip_port(), integer()]),
|
||||||
#{required => true}
|
#{
|
||||||
|
required => true,
|
||||||
|
desc => "IP address and port for the listening socket."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"acceptors",
|
{"acceptors",
|
||||||
sc(
|
sc(
|
||||||
integer(),
|
integer(),
|
||||||
#{default => 16}
|
#{
|
||||||
|
default => 16,
|
||||||
|
desc => "The size of the listener's receiving pool."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"max_connections",
|
{"max_connections",
|
||||||
sc(
|
sc(
|
||||||
hoconsc:union([infinity, integer()]),
|
hoconsc:union([infinity, integer()]),
|
||||||
#{default => infinity}
|
#{
|
||||||
|
default => infinity,
|
||||||
|
desc => "The maximum number of concurrent connections allowed by the listener."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"mountpoint",
|
{"mountpoint",
|
||||||
sc(
|
sc(
|
||||||
binary(),
|
binary(),
|
||||||
#{default => <<>>}
|
#{
|
||||||
|
default => <<>>,
|
||||||
|
desc =>
|
||||||
|
"When publishing or subscribing, prefix all topics with a mountpoint string.\n"
|
||||||
|
" The prefixed string will be removed from the topic name when the message\n"
|
||||||
|
" is delivered to the subscriber. The mountpoint is a way that users can use\n"
|
||||||
|
" to implement isolation of message routing between different listeners.\n"
|
||||||
|
" For example if a client A subscribes to `t` with `listeners.tcp.<name>.mountpoint`\n"
|
||||||
|
" set to `some_tenant`, then the client actually subscribes to the topic\n"
|
||||||
|
" `some_tenant/t`. Similarly, if another client B (connected to the same listener\n"
|
||||||
|
" as the client A) sends a message to topic `t`, the message is routed\n"
|
||||||
|
" to all the clients subscribed `some_tenant/t`, so client A will receive the\n"
|
||||||
|
" message, with topic name `t`.<br/>\n"
|
||||||
|
" Set to `\"\"` to disable the feature.<br/>\n"
|
||||||
|
"\n"
|
||||||
|
" Variables in mountpoint string:\n"
|
||||||
|
" - <code>${clientid}</code>: clientid\n"
|
||||||
|
" - <code>${username}</code>: username"
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"zone",
|
{"zone",
|
||||||
sc(
|
sc(
|
||||||
atom(),
|
atom(),
|
||||||
#{default => 'default'}
|
#{
|
||||||
|
default => 'default',
|
||||||
|
desc => "The configuration zone to which the listener belongs."
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"limiter",
|
{"limiter",
|
||||||
sc(map("ratelimit's type", emqx_limiter_schema:bucket_name()), #{default => #{}})}
|
sc(map("ratelimit's type", emqx_limiter_schema:bucket_name()), #{default => #{}})}
|
||||||
|
|
|
@ -626,7 +626,9 @@ fields("log") ->
|
||||||
, {"error_logger",
|
, {"error_logger",
|
||||||
sc(atom(),
|
sc(atom(),
|
||||||
#{mapping => "kernel.error_logger",
|
#{mapping => "kernel.error_logger",
|
||||||
default => silent})}
|
default => silent,
|
||||||
|
desc => "Deprecated."
|
||||||
|
})}
|
||||||
];
|
];
|
||||||
|
|
||||||
fields("console_handler") ->
|
fields("console_handler") ->
|
||||||
|
|
|
@ -49,22 +49,39 @@ fields("http") ->
|
||||||
hoconsc:enum([http, https]),
|
hoconsc:enum([http, https]),
|
||||||
#{ desc => "HTTP/HTTPS protocol."
|
#{ desc => "HTTP/HTTPS protocol."
|
||||||
, required => true
|
, required => true
|
||||||
, default => http})}
|
, default => http
|
||||||
|
})}
|
||||||
, {"bind", fun bind/1}
|
, {"bind", fun bind/1}
|
||||||
, {"num_acceptors", sc(
|
, {"num_acceptors", sc(
|
||||||
integer(),
|
integer(),
|
||||||
#{ default => 4
|
#{ default => 4
|
||||||
, desc => "Socket acceptor pool for TCP protocols."
|
, desc => "Socket acceptor pool size for TCP protocols."
|
||||||
})}
|
})}
|
||||||
, {"max_connections", sc(integer(), #{default => 512})}
|
, {"max_connections",
|
||||||
, {"backlog", sc(
|
sc(integer(),
|
||||||
integer(),
|
#{ default => 512
|
||||||
#{ default => 1024
|
, desc => "Maximum number of simultaneous connections."
|
||||||
, desc => "Defines the maximum length that the queue of pending connections can grow to."
|
})}
|
||||||
})}
|
, {"backlog",
|
||||||
, {"send_timeout", sc(emqx_schema:duration(), #{default => "5s"})}
|
sc(integer(),
|
||||||
, {"inet6", sc(boolean(), #{default => false})}
|
#{ default => 1024
|
||||||
, {"ipv6_v6only", sc(boolean(), #{default => false})}
|
, desc => "Defines the maximum length that the queue of pending connections can grow to."
|
||||||
|
})}
|
||||||
|
, {"send_timeout",
|
||||||
|
sc(emqx_schema:duration(),
|
||||||
|
#{ default => "5s"
|
||||||
|
, desc => "Send timeout for the socket."
|
||||||
|
})}
|
||||||
|
, {"inet6",
|
||||||
|
sc(boolean(),
|
||||||
|
#{ default => false
|
||||||
|
, desc => "Sets up the listener for IPv6."
|
||||||
|
})}
|
||||||
|
, {"ipv6_v6only",
|
||||||
|
sc(boolean(),
|
||||||
|
#{ default => false
|
||||||
|
, desc => "Disable IPv4-to-IPv6 mapping for the listener."
|
||||||
|
})}
|
||||||
];
|
];
|
||||||
|
|
||||||
fields("https") ->
|
fields("https") ->
|
||||||
|
@ -81,6 +98,7 @@ bind(_) -> undefined.
|
||||||
default_username(type) -> string();
|
default_username(type) -> string();
|
||||||
default_username(default) -> "admin";
|
default_username(default) -> "admin";
|
||||||
default_username(required) -> true;
|
default_username(required) -> true;
|
||||||
|
default_username(desc) -> "The default username of the automatically created dashboard user.";
|
||||||
default_username(_) -> undefined.
|
default_username(_) -> undefined.
|
||||||
|
|
||||||
default_password(type) -> string();
|
default_password(type) -> string();
|
||||||
|
|
|
@ -126,12 +126,10 @@ fields("event_message") ->
|
||||||
#{
|
#{
|
||||||
fields => Fields,
|
fields => Fields,
|
||||||
desc =>
|
desc =>
|
||||||
""
|
|
||||||
"\n"
|
|
||||||
"Enable/Disable system event messages.\n"
|
"Enable/Disable system event messages.\n"
|
||||||
"The messages are published to '$event' prefixed topics.\n"
|
"The messages are published to <code>$event</code> prefixed topics.\n"
|
||||||
"For example, if `client_disconnected` is set to `true`,\n"
|
"For example, if `client_disconnected` is set to `true`,\n"
|
||||||
"a message is published to `$event/client_connected` topic\n"
|
"a message is published to <code>$event/client_connected</code> topic\n"
|
||||||
"whenever a client is connected.\n"
|
"whenever a client is connected.\n"
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue