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