feat(conf): cluster/node conf to hocon

This commit is contained in:
Turtle 2021-07-02 12:11:47 +08:00 committed by turtleDeng
parent 2c7fd0b547
commit 8266a79867
1 changed files with 270 additions and 268 deletions

View File

@ -1,319 +1,321 @@
## EMQ X Configuration 4.3 ## EMQ X Configuration 4.3
## NOTE: Do not change format of CONFIG_SECTION_{BGN,END} comments!
## CONFIG_SECTION_BGN=cluster ==================================================
## Cluster name.
##
## Value: String
cluster.name = emqxcl
## Specify the erlang distributed protocol.
##
## Value: Enum
## - inet_tcp: the default; handles TCP streams with IPv4 addressing.
## - inet6_tcp: handles TCP with IPv6 addressing.
## - inet_tls: using TLS for Erlang Distribution.
##
## vm.args: -proto_dist inet_tcp
cluster.proto_dist = inet_tcp
## Cluster auto-discovery strategy.
##
## Value: Enum
## - manual: Manual join command
## - static: Static node list
## - mcast: IP Multicast
## - dns: DNS A Record
## - etcd: etcd
## - k8s: Kubernetes
##
## Default: manual
cluster.discovery = manual
## Enable cluster autoheal from network partition.
##
## Value: on | off
##
## Default: on
cluster.autoheal = on
## Autoclean down node. A down node will be removed from the cluster
## if this value > 0.
##
## Value: Duration
## -h: hour, e.g. '2h' for 2 hours
## -m: minute, e.g. '5m' for 5 minutes
## -s: second, e.g. '30s' for 30 seconds
##
## Default: 5m
cluster.autoclean = 5m
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Cluster using static node list ## Cluster
## Node list of the cluster.
##
## Value: String
## cluster.static.seeds = "emqx1@127.0.0.1,emqx2@127.0.0.1"
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Cluster using IP Multicast. cluster: {
## Cluster name.
##
## Value: String
name: emqxcl
## IP Multicast Address. ## Cluster auto-discovery strategy.
## ##
## Value: IP Address ## Value: Enum
## cluster.mcast.addr = "239.192.0.1" ## - manual: Manual join command
## - static: Static node list
## - mcast: IP Multicast
## - dns: DNS A Record
## - etcd: etcd
## - k8s: Kubernetes
##
## Default: manual
discovery: manual
## Multicast Ports. ## Autoclean down node. A down node will be removed from the cluster
## ## if this value > 0.
## Value: Port List ##
## cluster.mcast.ports = "4369,4370" ## Value: Duration
## -h: hour, e.g. '2h' for 2 hours
## -m: minute, e.g. '5m' for 5 minutes
## -s: second, e.g. '30s' for 30 seconds
##
## Default: 5m
autoclean: "5m"
## Multicast Iface. ## Enable cluster autoheal from network partition.
## ##
## Value: Iface Address ## Value: on | off
## ##
## Default: "0.0.0.0" ## Default: on
## cluster.mcast.iface = "0.0.0.0" autoheal: on
## Multicast Ttl. ## Specify the erlang distributed protocol.
## ##
## Value: 0-255 ## Value: Enum
## cluster.mcast.ttl = 255 ## - inet_tcp: the default; handles TCP streams with IPv4 addressing.
## - inet6_tcp: handles TCP with IPv6 addressing.
## - inet_tls: using TLS for Erlang Distribution.
##
## vm.args: -proto_dist inet_tcp
proto_dist: inet_tcp
## Multicast loop. ## Cluster using static node list
## static: {
## Value: on | off ## Node list of the cluster.
## cluster.mcast.loop = on ##
## Value: String
## seeds: "emqx1@127.0.0.1,emqx2@127.0.0.1"
}
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Cluster using DNS A records. ## Cluster using IP Multicast.
mcast: {
## IP Multicast Address.
##
## Value: IP Address
## addr = "239.192.0.1"
## DNS name. ## Multicast Ports.
## ##
## Value: String ## Value: Port List
## cluster.dns.name = localhost ## ports = "4369,4370"
## The App name is used to build 'node.name' with IP address. ## Multicast Iface.
## ##
## Value: String ## Value: Iface Address
## cluster.dns.app = emqx ##
## Default: "0.0.0.0"
## iface: "0.0.0.0"
##-------------------------------------------------------------------- ## Multicast Ttl.
## Cluster using etcd ##
## Value: 0-255
## ttl: 255
## Etcd server list, seperated by ','. ## Multicast loop.
## ##
## Value: String ## Value: on | off
## cluster.etcd.server = "http://127.0.0.1:2379" ## loop: on
}
## Etcd api version ##--------------------------------------------------------------------
## ## Cluster using DNS A records.
## Value: Enum dns: {
## - v2 ## DNS name.
## - v3 ##
## cluster.etcd.version = v3 ## Value: String
## name: localhost
## The prefix helps build nodes path in etcd. Each node in the cluster ## The App name is used to build 'node.name' with IP address.
## will create a path in etcd: v2/keys/<prefix>/<cluster.name>/<node.name> ##
## ## Value: String
## Value: String ## app: emqx
## cluster.etcd.prefix = emqxcl }
## The TTL for node's path in etcd. ##--------------------------------------------------------------------
## ## Cluster using etcd
## Value: Duration etcd: {
## ## Etcd server list, seperated by ','.
## Default: 1m, 1 minute ##
## cluster.etcd.node_ttl = 1m ## Value: String
## server: "http://127.0.0.1:2379"
## Path to a file containing the client's private PEM-encoded key. ## Etcd api version
## ##
## Value: File ## Value: Enum
## cluster.etcd.ssl.keyfile = "{{ platform_etc_dir }}/certs/client-key.pem" ## - v2
## - v3
## version: v3
## The path to a file containing the client's certificate. ## The prefix helps build nodes path in etcd. Each node in the cluster
## ## will create a path in etcd: v2/keys/<prefix>/<cluster.name>/<node.name>
## Value: File ##
## cluster.etcd.ssl.certfile = "{{ platform_etc_dir }}/certs/client.pem" ## Value: String
## prefix: emqxcl
## Path to the file containing PEM-encoded CA certificates. The CA certificates ## The TTL for node's path in etcd.
## are used during server authentication and when building the client certificate chain. ##
## ## Value: Duration
## Value: File ##
## cluster.etcd.ssl.cacertfile = "{{ platform_etc_dir }}/certs/ca.pem" ## Default: 1m, 1 minute
## node_ttl: 1m
##-------------------------------------------------------------------- ## ssl:{
## Cluster using Kubernetes ## Path to a file containing the client's private PEM-encoded key.
## Value: File
## keyfile: "{{ platform_etc_dir }}/certs/client-key.pem"
## Kubernetes API server list, seperated by ','. ## The path to a file containing the client's certificate.
## ## Value: File
## Value: String ## certfile: "{{ platform_etc_dir }}/certs/client.pem"
## cluster.k8s.apiserver = "http://10.110.111.204:8080"
## The service name helps lookup EMQ nodes in the cluster. ## Path to the file containing PEM-encoded CA certificates. The CA certificates
## ## are used during server authentication and when building the client certificate chain.
## Value: String ## Value: File
## cluster.k8s.service_name = emqx ## cacertfile: "{{ platform_etc_dir }}/certs/ca.pem"
# }
}
##--------------------------------------------------------------------
## Cluster using Kubernetes
k8s: {
# Kubernetes API server list, seperated by ','.
# Value: String
# apiserver: "http://10.110.111.204:8080"
## The address type is used to extract host from k8s service. # The service name helps lookup EMQ nodes in the cluster.
## # Value: String
## Value: ip | dns | hostname # service_name: emqx
## cluster.k8s.address_type = ip
## The app name helps build 'node.name'. # The address type is used to extract host from k8s service.
## # Value: ip | dns | hostname
## Value: String # address_type: ip
## cluster.k8s.app_name = emqx
## The suffix added to dns and hostname get from k8s service # The app name helps build 'node.name'.
## # Value: String
## Value: String # app_name: emqx
## cluster.k8s.suffix = pod.cluster.local
## Kubernetes Namespace # The suffix added to dns and hostname get from k8s service
## # Value: String
## Value: String # suffix: pod.cluster.local
## cluster.k8s.namespace = default
## CONFIG_SECTION_END=cluster ================================================== # Kubernetes Namespace
# Value: String
# namespace: default
}
db_backend: mnesia
rlog: {
# role: core
# core_nodes: []
}
}
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Node ## Node
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
node: {
## Node name.
##
## See: http://erlang.org/doc/reference_manual/distributed.html
##
## Value: <name>@<host>
##
## Default: emqx@127.0.0.1
name: "emqx@127.0.0.1"
## Node name. ## Cookie for distributed node communication.
## ##
## See: http://erlang.org/doc/reference_manual/distributed.html ## Value: String
## cookie: "emqxsecretcookie"
## Value: <name>@<host>
##
## Default: emqx@127.0.0.1
node.name = "emqx@127.0.0.1"
## Cookie for distributed node communication. ## Data dir for the node
## ##
## Value: String ## Value: Folder
node.cookie = "emqxsecretcookie" data_dir: "{{ platform_data_dir }}"
## Data dir for the node ## The config file dir for the node
## ##
## Value: Folder ## Value: Folder
node.data_dir = "{{ platform_data_dir }}" etc_dir: "{{ platform_etc_dir }}"
## The config file dir for the node ## Heartbeat monitoring of an Erlang runtime system. Comment the line to disable
## ## heartbeat, or set the value as 'on'
## Value: Folder ##
node.etc_dir = "{{ platform_etc_dir }}" ## Value: on
##
## vm.args: -heart
## heartbeat: on
## Heartbeat monitoring of an Erlang runtime system. Comment the line to disable ## Sets the number of threads in async thread pool. Valid range is 0-1024.
## heartbeat, or set the value as 'on' ##
## ## See: http://erlang.org/doc/man/erl.html
## Value: on ##
## ## Value: 0-1024
## vm.args: -heart ##
## node.heartbeat = on ## vm.args: +A Number
## async_threads: 4
## Sets the number of threads in async thread pool. Valid range is 0-1024. ## Sets the maximum number of simultaneously existing processes for this
## ## system if a Number is passed as value.
## See: http://erlang.org/doc/man/erl.html ##
## ## See: http://erlang.org/doc/man/erl.html
## Value: 0-1024 ##
## ## Value: Number [1024-134217727]
## vm.args: +A Number ##
## node.async_threads = 4 ## vm.args: +P Number
## process_limit: 2097152
## Sets the maximum number of simultaneously existing processes for this ## Sets the maximum number of simultaneously existing ports for this system.
## system if a Number is passed as value. ##
## ## See: http://erlang.org/doc/man/erl.html
## See: http://erlang.org/doc/man/erl.html ##
## ## Value: Number [1024-134217727]
## Value: Number [1024-134217727] ##
## ## vm.args: +Q Number
## vm.args: +P Number ## max_ports: 1048576
## node.process_limit = 2097152
## Sets the maximum number of simultaneously existing ports for this system. ## Sets the distribution buffer busy limit (dist_buf_busy_limit).
## ##
## See: http://erlang.org/doc/man/erl.html ## See: http://erlang.org/doc/man/erl.html
## ##
## Value: Number [1024-134217727] ## Value: Number [1KB-2GB]
## ##
## vm.args: +Q Number ## vm.args: +zdbbl size
## node.max_ports = 1048576 ## dist_buffer_size: 8MB
## Sets the distribution buffer busy limit (dist_buf_busy_limit). ## Sets the maximum number of ETS tables. Note that mnesia and SSL will
## ## create temporary ETS tables.
## See: http://erlang.org/doc/man/erl.html ##
## ## Value: Number
## Value: Number [1KB-2GB] ##
## ## vm.args: +e Number
## vm.args: +zdbbl size ## max_ets_tables: 262144
## node.dist_buffer_size = 8MB
## Sets the maximum number of ETS tables. Note that mnesia and SSL will ## Global GC Interval.
## create temporary ETS tables. ##
## ## Value: Duration
## Value: Number ##
## ## Examples:
## vm.args: +e Number ## - 2h: 2 hours
## node.max_ets_tables = 262144 ## - 30m: 30 minutes
## - 20s: 20 seconds
##
## Defaut: 15 minutes
global_gc_interval: 15m
## Global GC Interval. ## Tweak GC to run more often.
## ##
## Value: Duration ## Value: Number [0-65535]
## ##
## Examples: ## vm.args: -env ERL_FULLSWEEP_AFTER Number
## - 2h: 2 hours ## fullsweep_after: 1000
## - 30m: 30 minutes
## - 20s: 20 seconds
##
## Defaut: 15 minutes
node.global_gc_interval = 15m
## Tweak GC to run more often. ## Crash dump log file.
## ##
## Value: Number [0-65535] ## Value: Log file
## crash_dump: "{{ platform_log_dir }}/crash.dump"
## vm.args: -env ERL_FULLSWEEP_AFTER Number
## node.fullsweep_after = 1000
## Crash dump log file. ## Specify SSL Options in the file if using SSL for Erlang Distribution.
## ##
## Value: Log file ## Value: File
node.crash_dump = "{{ platform_log_dir }}/crash.dump" ##
## vm.args: -ssl_dist_optfile <File>
## node.ssl_dist_optfile = "{{ platform_etc_dir }}/ssl_dist.conf"
## Specify SSL Options in the file if using SSL for Erlang Distribution. ## Sets the net_kernel tick time. TickTime is specified in seconds.
## ## Notice that all communicating nodes are to have the same TickTime
## Value: File ## value specified.
## ##
## vm.args: -ssl_dist_optfile <File> ## See: http://www.erlang.org/doc/man/kernel_app.html#net_ticktime
## node.ssl_dist_optfile = "{{ platform_etc_dir }}/ssl_dist.conf" ##
## Value: Number
##
## vm.args: -kernel net_ticktime Number
## dist_net_ticktime: 120
## Sets the net_kernel tick time. TickTime is specified in seconds. ## Sets the port range for the listener socket of a distributed Erlang node.
## Notice that all communicating nodes are to have the same TickTime ## Note that if there are firewalls between clustered nodes, this port segment
## value specified. ## for nodes communication should be allowed.
## ##
## See: http://www.erlang.org/doc/man/kernel_app.html#net_ticktime ## See: http://www.erlang.org/doc/man/kernel_app.html
## ##
## Value: Number ## Value: Port [1024-65535]
## dist_listen_min: 6369
## vm.args: -kernel net_ticktime Number dist_listen_max: 6369
## node.dist_net_ticktime = 120 backtrace_depth: 16
}
## Sets the port range for the listener socket of a distributed Erlang node.
## Note that if there are firewalls between clustered nodes, this port segment
## for nodes communication should be allowed.
##
## See: http://www.erlang.org/doc/man/kernel_app.html
##
## Value: Port [1024-65535]
node.dist_listen_min = 6369
node.dist_listen_max = 6369
node.backtrace_depth = 16
## CONFIG_SECTION_BGN=rpc ====================================================== ## CONFIG_SECTION_BGN=rpc ======================================================