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