diff --git a/apps/emqx/etc/emqx.conf b/apps/emqx/etc/emqx.conf index c3368a0c7..d179b9a11 100644 --- a/apps/emqx/etc/emqx.conf +++ b/apps/emqx/etc/emqx.conf @@ -1,319 +1,321 @@ ## 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 - -## Node list of the cluster. -## -## Value: String -## cluster.static.seeds = "emqx1@127.0.0.1,emqx2@127.0.0.1" - +## Cluster ##-------------------------------------------------------------------- -## Cluster using IP Multicast. +cluster: { + ## Cluster name. + ## + ## Value: String + name: emqxcl -## IP Multicast Address. -## -## Value: IP Address -## cluster.mcast.addr = "239.192.0.1" + ## 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 + discovery: manual -## Multicast Ports. -## -## Value: Port List -## cluster.mcast.ports = "4369,4370" + ## 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 + autoclean: "5m" -## Multicast Iface. -## -## Value: Iface Address -## -## Default: "0.0.0.0" -## cluster.mcast.iface = "0.0.0.0" + ## Enable cluster autoheal from network partition. + ## + ## Value: on | off + ## + ## Default: on + autoheal: on -## Multicast Ttl. -## -## Value: 0-255 -## cluster.mcast.ttl = 255 + ## 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 -## Multicast loop. -## -## Value: on | off -## cluster.mcast.loop = on + ## Cluster using static node list + static: { + ## Node list of the cluster. + ## + ## 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. -## -## Value: String -## cluster.dns.name = localhost + ## Multicast Ports. + ## + ## Value: Port List + ## ports = "4369,4370" -## The App name is used to build 'node.name' with IP address. -## -## Value: String -## cluster.dns.app = emqx + ## Multicast Iface. + ## + ## Value: Iface Address + ## + ## Default: "0.0.0.0" + ## iface: "0.0.0.0" -##-------------------------------------------------------------------- -## Cluster using etcd + ## Multicast Ttl. + ## + ## Value: 0-255 + ## ttl: 255 -## Etcd server list, seperated by ','. -## -## Value: String -## cluster.etcd.server = "http://127.0.0.1:2379" + ## Multicast loop. + ## + ## Value: on | off + ## loop: on + } -## Etcd api version -## -## Value: Enum -## - v2 -## - v3 -## cluster.etcd.version = v3 + ##-------------------------------------------------------------------- + ## Cluster using DNS A records. + dns: { + ## DNS name. + ## + ## Value: String + ## name: localhost -## The prefix helps build nodes path in etcd. Each node in the cluster -## will create a path in etcd: v2/keys/// -## -## Value: String -## cluster.etcd.prefix = emqxcl + ## The App name is used to build 'node.name' with IP address. + ## + ## Value: String + ## app: emqx + } -## The TTL for node's path in etcd. -## -## Value: Duration -## -## Default: 1m, 1 minute -## cluster.etcd.node_ttl = 1m + ##-------------------------------------------------------------------- + ## Cluster using etcd + etcd: { + ## Etcd server list, seperated by ','. + ## + ## Value: String + ## server: "http://127.0.0.1:2379" -## 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" + ## Etcd api version + ## + ## Value: Enum + ## - v2 + ## - v3 + ## version: v3 -## The path to a file containing the client's certificate. -## -## Value: File -## cluster.etcd.ssl.certfile = "{{ platform_etc_dir }}/certs/client.pem" + ## The prefix helps build nodes path in etcd. Each node in the cluster + ## will create a path in etcd: v2/keys/// + ## + ## Value: String + ## prefix: emqxcl -## 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" + ## The TTL for node's path in etcd. + ## + ## Value: Duration + ## + ## Default: 1m, 1 minute + ## node_ttl: 1m -##-------------------------------------------------------------------- -## Cluster using Kubernetes + ## ssl:{ + ## 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 ','. -## -## Value: String -## cluster.k8s.apiserver = "http://10.110.111.204:8080" + ## The path to a file containing the client's certificate. + ## Value: File + ## certfile: "{{ platform_etc_dir }}/certs/client.pem" -## The service name helps lookup EMQ nodes in the cluster. -## -## Value: String -## cluster.k8s.service_name = emqx + ## 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 + ## 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. -## -## Value: ip | dns | hostname -## cluster.k8s.address_type = ip + # The service name helps lookup EMQ nodes in the cluster. + # Value: String + # service_name: emqx -## The app name helps build 'node.name'. -## -## Value: String -## cluster.k8s.app_name = emqx + # The address type is used to extract host from k8s service. + # Value: ip | dns | hostname + # address_type: ip -## The suffix added to dns and hostname get from k8s service -## -## Value: String -## cluster.k8s.suffix = pod.cluster.local + # The app name helps build 'node.name'. + # Value: String + # app_name: emqx -## Kubernetes Namespace -## -## Value: String -## cluster.k8s.namespace = default + # The suffix added to dns and hostname get from k8s service + # Value: String + # suffix: pod.cluster.local -## CONFIG_SECTION_END=cluster ================================================== + # Kubernetes Namespace + # Value: String + # namespace: default + } + db_backend: mnesia + rlog: { + # role: core + # core_nodes: [] + } + +} ##-------------------------------------------------------------------- ## Node ##-------------------------------------------------------------------- +node: { + ## Node name. + ## + ## See: http://erlang.org/doc/reference_manual/distributed.html + ## + ## Value: @ + ## + ## Default: emqx@127.0.0.1 + name: "emqx@127.0.0.1" -## Node name. -## -## See: http://erlang.org/doc/reference_manual/distributed.html -## -## Value: @ -## -## Default: emqx@127.0.0.1 -node.name = "emqx@127.0.0.1" + ## Cookie for distributed node communication. + ## + ## Value: String + cookie: "emqxsecretcookie" -## Cookie for distributed node communication. -## -## Value: String -node.cookie = "emqxsecretcookie" + ## Data dir for the node + ## + ## Value: Folder + data_dir: "{{ platform_data_dir }}" -## Data dir for the node -## -## Value: Folder -node.data_dir = "{{ platform_data_dir }}" + ## The config file dir for the node + ## + ## Value: Folder + etc_dir: "{{ platform_etc_dir }}" -## The config file dir for the node -## -## Value: Folder -node.etc_dir = "{{ platform_etc_dir }}" + ## Heartbeat monitoring of an Erlang runtime system. Comment the line to disable + ## heartbeat, or set the value as 'on' + ## + ## Value: on + ## + ## vm.args: -heart + ## heartbeat: on -## Heartbeat monitoring of an Erlang runtime system. Comment the line to disable -## heartbeat, or set the value as 'on' -## -## Value: on -## -## vm.args: -heart -## node.heartbeat = on + ## Sets the number of threads in async thread pool. Valid range is 0-1024. + ## + ## See: http://erlang.org/doc/man/erl.html + ## + ## Value: 0-1024 + ## + ## vm.args: +A Number + ## async_threads: 4 -## Sets the number of threads in async thread pool. Valid range is 0-1024. -## -## See: http://erlang.org/doc/man/erl.html -## -## Value: 0-1024 -## -## vm.args: +A Number -## node.async_threads = 4 + ## 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 + ## + ## Value: Number [1024-134217727] + ## + ## vm.args: +P Number + ## process_limit: 2097152 -## 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 -## -## Value: Number [1024-134217727] -## -## vm.args: +P Number -## node.process_limit = 2097152 + ## Sets the maximum number of simultaneously existing ports for this system. + ## + ## See: http://erlang.org/doc/man/erl.html + ## + ## Value: Number [1024-134217727] + ## + ## vm.args: +Q Number + ## max_ports: 1048576 -## Sets the maximum number of simultaneously existing ports for this system. -## -## See: http://erlang.org/doc/man/erl.html -## -## Value: Number [1024-134217727] -## -## vm.args: +Q Number -## node.max_ports = 1048576 + ## Sets the distribution buffer busy limit (dist_buf_busy_limit). + ## + ## See: http://erlang.org/doc/man/erl.html + ## + ## Value: Number [1KB-2GB] + ## + ## vm.args: +zdbbl size + ## dist_buffer_size: 8MB -## Sets the distribution buffer busy limit (dist_buf_busy_limit). -## -## See: http://erlang.org/doc/man/erl.html -## -## Value: Number [1KB-2GB] -## -## vm.args: +zdbbl size -## node.dist_buffer_size = 8MB + ## Sets the maximum number of ETS tables. Note that mnesia and SSL will + ## create temporary ETS tables. + ## + ## Value: Number + ## + ## vm.args: +e Number + ## max_ets_tables: 262144 -## Sets the maximum number of ETS tables. Note that mnesia and SSL will -## create temporary ETS tables. -## -## Value: Number -## -## vm.args: +e Number -## node.max_ets_tables = 262144 + ## Global GC Interval. + ## + ## Value: Duration + ## + ## Examples: + ## - 2h: 2 hours + ## - 30m: 30 minutes + ## - 20s: 20 seconds + ## + ## Defaut: 15 minutes + global_gc_interval: 15m -## Global GC Interval. -## -## Value: Duration -## -## Examples: -## - 2h: 2 hours -## - 30m: 30 minutes -## - 20s: 20 seconds -## -## Defaut: 15 minutes -node.global_gc_interval = 15m + ## Tweak GC to run more often. + ## + ## Value: Number [0-65535] + ## + ## vm.args: -env ERL_FULLSWEEP_AFTER Number + ## fullsweep_after: 1000 -## Tweak GC to run more often. -## -## Value: Number [0-65535] -## -## vm.args: -env ERL_FULLSWEEP_AFTER Number -## node.fullsweep_after = 1000 + ## Crash dump log file. + ## + ## Value: Log file + crash_dump: "{{ platform_log_dir }}/crash.dump" -## Crash dump log file. -## -## Value: Log file -node.crash_dump = "{{ platform_log_dir }}/crash.dump" + ## Specify SSL Options in the file if using SSL for Erlang Distribution. + ## + ## Value: File + ## + ## vm.args: -ssl_dist_optfile + ## node.ssl_dist_optfile = "{{ platform_etc_dir }}/ssl_dist.conf" -## Specify SSL Options in the file if using SSL for Erlang Distribution. -## -## Value: File -## -## vm.args: -ssl_dist_optfile -## node.ssl_dist_optfile = "{{ platform_etc_dir }}/ssl_dist.conf" + ## Sets the net_kernel tick time. TickTime is specified in seconds. + ## Notice that all communicating nodes are to have the same TickTime + ## value specified. + ## + ## See: http://www.erlang.org/doc/man/kernel_app.html#net_ticktime + ## + ## Value: Number + ## + ## vm.args: -kernel net_ticktime Number + ## dist_net_ticktime: 120 -## Sets the net_kernel tick time. TickTime is specified in seconds. -## Notice that all communicating nodes are to have the same TickTime -## value specified. -## -## See: http://www.erlang.org/doc/man/kernel_app.html#net_ticktime -## -## Value: Number -## -## vm.args: -kernel net_ticktime Number -## node.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 + ## for nodes’ communication should be allowed. + ## + ## See: http://www.erlang.org/doc/man/kernel_app.html + ## + ## Value: Port [1024-65535] + dist_listen_min: 6369 + dist_listen_max: 6369 + 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 ======================================================