feat(hocon): convert config format of rpc and log to hocon

This commit is contained in:
zhouzb 2021-07-02 13:54:37 +08:00 committed by turtleDeng
parent 092c5455c8
commit c7cbe819ed
1 changed files with 253 additions and 250 deletions

View File

@ -316,293 +316,296 @@ node: {
backtrace_depth: 16 backtrace_depth: 16
} }
##--------------------------------------------------------------------
## RPC
##--------------------------------------------------------------------
## CONFIG_SECTION_BGN=rpc ====================================================== rpc: {
## RPC Mode.
##
## Value: sync | async
mode: async
## RPC Mode. ## Max batch size of async RPC requests.
## ##
## Value: sync | async ## Value: Integer
rpc.mode = async ## Zero or negative value disables rpc batching.
##
## NOTE: RPC batch won't work when rpc.mode = sync
async_batch_size: 256
## Max batch size of async RPC requests. ## RPC port discovery
## ##
## Value: Integer ## The strategy for discovering the RPC listening port of other nodes.
## Zero or negative value disables rpc batching. ##
## ## Value: Enum
## NOTE: RPC batch won't work when rpc.mode = sync ## - manual: discover ports by `tcp_server_port` and `tcp_client_port`.
rpc.async_batch_size = 256 ## - 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>`
##
## Defaults to `stateless`.
port_discovery: stateless
## RPC port discovery ## TCP port number for RPC server to listen on.
## ##
## The strategy for discovering the RPC listening port of other nodes. ## Only takes effect when `rpc.port_discovery` = `manual`.
## ##
## Value: Enum ## NOTE: All nodes in the cluster should agree to this same config.
## - manual: discover ports by `tcp_server_port` and `tcp_client_port`. ##
## - stateless: discover ports in a stateless manner. ## Value: Port [1024-65535]
## If node name is `emqx<N>@127.0.0.1`, where the `<N>` is an integer, ## tcp_server_port: 5369
## then the listening port will be `5370 + <N>`
##
## Defaults to `stateless`.
rpc.port_discovery = stateless
## TCP port number for RPC server to listen on. ## Number of outgoing RPC connections.
## ##
## Only takes effect when `rpc.port_discovery` = `manual`. ## Value: Interger [0-256]
## ## Default: 1
## NOTE: All nodes in the cluster should agree to this same config. ## tcp_client_num: 1
##
## Value: Port [1024-65535]
#rpc.tcp_server_port = 5369
## Number of outgoing RPC connections. ## RCP Client connect timeout.
## ##
## Value: Interger [0-256] ## Value: Seconds
## Default = 1 connect_timeout: 5s
#rpc.tcp_client_num = 1
## RCP Client connect timeout. ## TCP send timeout of RPC client and server.
## ##
## Value: Seconds ## Value: Seconds
rpc.connect_timeout = 5s send_timeout: 5s
## TCP send timeout of RPC client and server. ## Authentication timeout
## ##
## Value: Seconds ## Value: Seconds
rpc.send_timeout = 5s authentication_timeout: 5s
## Authentication timeout ## Default receive timeout for call() functions
## ##
## Value: Seconds ## Value: Seconds
rpc.authentication_timeout = 5s call_receive_timeout: 15s
## Default receive timeout for call() functions ## Socket idle keepalive.
## ##
## Value: Seconds ## Value: Seconds
rpc.call_receive_timeout = 15s socket_keepalive_idle: 900s
## Socket idle keepalive. ## TCP Keepalive probes interval.
## ##
## Value: Seconds ## Value: Seconds
rpc.socket_keepalive_idle = 900s socket_keepalive_interval: 75s
## TCP Keepalive probes interval. ## Probes lost to close the connection
## ##
## Value: Seconds ## Value: Integer
rpc.socket_keepalive_interval = 75s socket_keepalive_count: 9
## Probes lost to close the connection ## Size of TCP send buffer.
## ##
## Value: Integer ## Value: Bytes
rpc.socket_keepalive_count = 9 socket_sndbuf: 1MB
## Size of TCP send buffer. ## Size of TCP receive buffer.
## ##
## Value: Bytes ## Value: Seconds
rpc.socket_sndbuf = 1MB socket_recbuf: 1MB
## Size of TCP receive buffer. ## Size of user-level software socket buffer.
## ##
## Value: Seconds ## Value: Seconds
rpc.socket_recbuf = 1MB socket_buffer: 1MB
}
## Size of user-level software socket buffer. ##--------------------------------------------------------------------
## ## Log
## Value: Seconds ##--------------------------------------------------------------------
rpc.socket_buffer = 1MB
## CONFIG_SECTION_END=rpc ====================================================== log: {
## Where to emit the logs.
## Enable the console (standard output) logs.
##
## Value: file | console | both
## - file: write logs only to file
## - console: write logs only to standard I/O
## - both: write logs both to file and standard I/O
to: file
## CONFIG_SECTION_BGN=logger =================================================== ## The log severity level.
##
## Value: debug | info | notice | warning | error | critical | alert | emergency
##
## Note: Only the messages with severity level higher than or equal to
## this level will be logged.
##
## Default: warning
level: warning
## Where to emit the logs. ## Timezone offset to display in logs
## Enable the console (standard output) logs. ## Value:
## ## - "system" use system zone
## Value: file | console | both ## - "utc" for Universal Coordinated Time (UTC)
## - file: write logs only to file ## - "+hh:mm" or "-hh:mm" for a specified offset
## - console: write logs only to standard I/O time_offset: system
## - both: write logs both to file and standard I/O
log.to = file
## The log severity level. ## The dir for log files.
## ##
## Value: debug | info | notice | warning | error | critical | alert | emergency ## Value: Folder
## dir: "{{ platform_log_dir }}"
## Note: Only the messages with severity level higher than or equal to
## this level will be logged.
##
## Default: warning
log.level = warning
## Timezone offset to display in logs ## The log filename for logs of level specified in "log.level".
## Value: ##
## - "system" use system zone ## If `log.rotation` is enabled, this is the base name of the
## - "utc" for Universal Coordinated Time (UTC) ## files. Each file in a rotated log is named <base_name>.N, where N is an integer.
## - "+hh:mm" or "-hh:mm" for a specified offset ##
log.time_offset = system ## Value: String
## Default: emqx.log
file: emqx.log
## The dir for log files. ## Limits the total number of characters printed for each log event.
## ##
## Value: Folder ## Value: Integer
log.dir = "{{ platform_log_dir }}" ## Default: No Limit
## chars_limit: 8192
## The log filename for logs of level specified in "log.level". ## Maximum depth for Erlang term log formatting
## ## and Erlang process message queue inspection.
## If `log.rotation` is enabled, this is the base name of the ##
## files. Each file in a rotated log is named <base_name>.N, where N is an integer. ## Value: Integer or 'unlimited' (without quotes)
## ## Default: 80
## Value: String ## max_depth: 80
## Default: emqx.log
log.file = emqx.log
## Limits the total number of characters printed for each log event. ## Log formatter
## ## Value: text | json
## Value: Integer ## formatter: text
## Default: No Limit
#log.chars_limit = 8192
## Maximum depth for Erlang term log formatting ## Log to single line
## and Erlang process message queue inspection. ## Value: Boolean
## ## single_line: true
## Value: Integer or 'unlimited' (without quotes)
## Default: 80
#log.max_depth = 80
## Log formatter ## Enables the log rotation.
## Value: text | json ## With this enabled, new log files will be created when the current
#log.formatter = text ## log file is full, max to `rotation.size` files will be created.
##
## Value: on | off
## Default: on
rotation.enable: on
## Log to single line ## Maximum size of each log file.
## Value: Boolean ##
#log.single_line = true ## Value: Number
## Default: 10M
## Supported Unit: KB | MB | GB
rotation.size: 10MB
## Enables the log rotation. ## Maximum rotation count of log files.
## With this enabled, new log files will be created when the current ##
## log file is full, max to `log.rotation.size` files will be created. ## Value: Number
## ## Default: 5
## Value: on | off rotation.count: 5
## Default: on
log.rotation.enable = on
## Maximum size of each log file. ## To create additional log files for specific log levels.
## ##
## Value: Number ## Value: File Name
## Default: 10M ## Format: log.$level.file = $filename,
## Supported Unit: KB | MB | GB ## where "$level" can be one of: debug, info, notice, warning,
log.rotation.size = 10MB ## error, critical, alert, emergency
## Note: Log files for a specific log level will only contain all the logs
## that higher than or equal to that level
##
## info.file: info.log
## error.file: error.log
## Maximum rotation count of log files. ## The max allowed queue length before switching to sync mode.
## ##
## Value: Number ## Log overload protection parameter. If the message queue grows
## Default: 5 ## larger than this value the handler switches from anync to sync mode.
log.rotation.count = 5 ##
## Default: 100
##
## sync_mode_qlen: 100
## To create additional log files for specific log levels. ## The max allowed queue length before switching to drop mode.
## ##
## Value: File Name ## Log overload protection parameter. When the message queue grows
## Format: log.$level.file = $filename, ## larger than this threshold, the handler switches to a mode in which
## where "$level" can be one of: debug, info, notice, warning, ## it drops all new events that senders want to log.
## error, critical, alert, emergency ##
## Note: Log files for a specific log level will only contain all the logs ## Default: 3000
## that higher than or equal to that level ##
## ## drop_mode_qlen: 3000
#log.info.file = info.log
#log.error.file = error.log
## The max allowed queue length before switching to sync mode. ## The max allowed queue length before switching to flush mode.
## ##
## Log overload protection parameter. If the message queue grows ## Log overload protection parameter. If the length of the message queue
## larger than this value the handler switches from anync to sync mode. ## grows larger than this threshold, a flush (delete) operation takes place.
## ## To flush events, the handler discards the messages in the message queue
## Default: 100 ## by receiving them in a loop without logging.
## ##
#log.sync_mode_qlen = 100 ## Default: 8000
##
## flush_qlen: 8000
## The max allowed queue length before switching to drop mode. ## Kill the log handler when it gets overloaded.
## ##
## Log overload protection parameter. When the message queue grows ## Log overload protection parameter. It is possible that a handler,
## larger than this threshold, the handler switches to a mode in which ## even if it can successfully manage peaks of high load without crashing,
## it drops all new events that senders want to log. ## can build up a large message queue, or use a large amount of memory.
## ## We could kill the log handler in these cases and restart it after a
## Default: 3000 ## few seconds.
## ##
#log.drop_mode_qlen = 3000 ## Default: on
##
## overload_kill: on
## The max allowed queue length before switching to flush mode. ## The max allowed queue length before killing the log hanlder.
## ##
## Log overload protection parameter. If the length of the message queue ## Log overload protection parameter. This is the maximum allowed queue
## grows larger than this threshold, a flush (delete) operation takes place. ## length. If the message queue grows larger than this, the handler
## To flush events, the handler discards the messages in the message queue ## process is terminated.
## by receiving them in a loop without logging. ##
## ## Default: 20000
## Default: 8000 ##
## ## overload_kill_qlen: 20000
#log.flush_qlen = 8000
## Kill the log handler when it gets overloaded. ## The max allowed memory size before killing the log hanlder.
## ##
## Log overload protection parameter. It is possible that a handler, ## Log overload protection parameter. This is the maximum memory size
## even if it can successfully manage peaks of high load without crashing, ## that the handler process is allowed to use. If the handler grows
## can build up a large message queue, or use a large amount of memory. ## larger than this, the process is terminated.
## We could kill the log handler in these cases and restart it after a ##
## few seconds. ## Default: 30MB
## ##
## Default: on ## overload_kill_mem_size: 30MB
##
#log.overload_kill = on
## The max allowed queue length before killing the log hanlder. ## Restart the log hanlder after some seconds.
## ##
## Log overload protection parameter. This is the maximum allowed queue ## Log overload protection parameter. If the handler is terminated,
## length. If the message queue grows larger than this, the handler ## it restarts automatically after a delay specified in seconds.
## process is terminated. ## The value "infinity" prevents restarts.
## ##
## Default: 20000 ## Default: 5s
## ##
#log.overload_kill_qlen = 20000 ## overload_kill_restart_after: 5s
## The max allowed memory size before killing the log hanlder. ## Max burst count and time window for burst control.
## ##
## Log overload protection parameter. This is the maximum memory size ## Log overload protection parameter. Large bursts of log events - many
## that the handler process is allowed to use. If the handler grows ## events received by the handler under a short period of time - can
## larger than this, the process is terminated. ## potentially cause problems. By specifying the maximum number of events
## ## to be handled within a certain time frame, the handler can avoid
## Default: 30MB ## choking the log with massive amounts of printouts.
## ##
#log.overload_kill_mem_size = 30MB ## This config controls the maximum number of events to handle within
## a time frame. After the limit is reached, successive events are
## Restart the log hanlder after some seconds. ## dropped until the end of the time frame.
## ##
## Log overload protection parameter. If the handler is terminated, ## Note that there would be no warning if any messages were
## it restarts automatically after a delay specified in seconds. ## dropped because of burst control.
## The value "infinity" prevents restarts. ##
## ## Comment this config out to disable the burst control feature.
## Default: 5s ##
## ## Value: MaxBurstCount,TimeWindow
#log.overload_kill_restart_after = 5s ## Default: disabled
##
## Max burst count and time window for burst control. ## burst_limit: "20000, 1s"
## }
## Log overload protection parameter. Large bursts of log events - many
## events received by the handler under a short period of time - can
## potentially cause problems. By specifying the maximum number of events
## to be handled within a certain time frame, the handler can avoid
## choking the log with massive amounts of printouts.
##
## This config controls the maximum number of events to handle within
## a time frame. After the limit is reached, successive events are
## dropped until the end of the time frame.
##
## Note that there would be no warning if any messages were
## dropped because of burst control.
##
## Comment this config out to disable the burst control feature.
##
## Value: MaxBurstCount,TimeWindow
## Default: disabled
##
#log.burst_limit = "20000, 1s"
## CONFIG_SECTION_END=logger ===================================================
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Authentication/Access Control ## Authentication/Access Control