docs(node): Add documentation for the node

This commit is contained in:
ieQu1 2022-02-21 19:19:34 +01:00
parent 6968deacb8
commit 2b2c6a4d1b
2 changed files with 22 additions and 8 deletions

View File

@ -247,28 +247,37 @@ fields(cluster_k8s) ->
fields("node") -> fields("node") ->
[ {"name", [ {"name",
sc(string(), sc(string(),
#{ default => "emqx@127.0.0.1" #{ default => "emqx@127.0.0.1",
desc => "Unique name of the EMQX node. It must follow <code>%name%@FQDN</code> or
<code>%name%@IP</code> format."
})} })}
, {"cookie", , {"cookie",
sc(string(), sc(string(),
#{ mapping => "vm_args.-setcookie", #{ mapping => "vm_args.-setcookie",
default => "emqxsecretcookie", default => "emqxsecretcookie",
sensitive => true sensitive => true,
desc => "Secret cookie is a random string that should be the same on all nodes in
the given EMQX cluster, but unique per EMQX cluster. It is used to prevent EMQX nodes that
belong to different clusters from accidentally connecting to each other."
})} })}
, {"data_dir", , {"data_dir",
sc(string(), sc(string(),
#{ nullable => false, #{ nullable => false,
mapping => "emqx.data_dir" mapping => "emqx.data_dir",
desc => "Path to the persistent data directory. It must be unique per broker instance."
})} })}
, {"config_files", , {"config_files",
sc(list(string()), sc(list(string()),
#{ mapping => "emqx.config_files" #{ mapping => "emqx.config_files"
, default => undefined , default => undefined
, desc => "List of configuration files that are read during startup. The order is
significant: later configuration files override the previous ones."
})} })}
, {"global_gc_interval", , {"global_gc_interval",
sc(emqx_schema:duration(), sc(emqx_schema:duration(),
#{ mapping => "emqx_machine.global_gc_interval" #{ mapping => "emqx_machine.global_gc_interval"
, default => "15m" , default => "15m"
, desc => "Periodic garbage collection interval."
})} })}
, {"crash_dump_file", , {"crash_dump_file",
sc(file(), sc(file(),
@ -279,10 +288,8 @@ fields("node") ->
sc(emqx_schema:duration_s(), sc(emqx_schema:duration_s(),
#{ mapping => "vm_args.-env ERL_CRASH_DUMP_SECONDS" #{ mapping => "vm_args.-env ERL_CRASH_DUMP_SECONDS"
, default => "30s" , default => "30s"
, desc => """ , desc => "The number of seconds that the broker is allowed to spend writing
The number of seconds that the broker is allowed to spend writing a crash dump"
a crash dump
"""
})} })}
, {"crash_dump_bytes", , {"crash_dump_bytes",
sc(emqx_schema:bytesize(), sc(emqx_schema:bytesize(),
@ -294,26 +301,33 @@ a crash dump
sc(emqx_schema:duration(), sc(emqx_schema:duration(),
#{ mapping => "vm_args.-kernel net_ticktime" #{ mapping => "vm_args.-kernel net_ticktime"
, default => "2m" , default => "2m"
, desc => "This is the approximate time an EMQX node may be unresponsive until it is considered down and thereby disconnected."
})} })}
, {"dist_listen_min", , {"dist_listen_min",
sc(range(1024, 65535), sc(range(1024, 65535),
#{ mapping => "kernel.inet_dist_listen_min" #{ mapping => "kernel.inet_dist_listen_min"
, default => 6369 , default => 6369
, desc => "Lower bound for the port range where EMQX broker listens for peer connections."
})} })}
, {"dist_listen_max", , {"dist_listen_max",
sc(range(1024, 65535), sc(range(1024, 65535),
#{ mapping => "kernel.inet_dist_listen_max" #{ mapping => "kernel.inet_dist_listen_max"
, default => 6369 , default => 6369
, desc => "Upper bound for the port range where EMQX broker listens for peer connections."
})} })}
, {"backtrace_depth", , {"backtrace_depth",
sc(integer(), sc(integer(),
#{ mapping => "emqx_machine.backtrace_depth" #{ mapping => "emqx_machine.backtrace_depth"
, default => 23 , default => 23
, desc => "Maximum depth of the call stack printed in error messages and
<code>process_info</code>."
})} })}
, {"applications", , {"applications",
sc(emqx_schema:comma_separated_atoms(), sc(emqx_schema:comma_separated_atoms(),
#{ mapping => "emqx_machine.applications" #{ mapping => "emqx_machine.applications"
, default => [] , default => []
, desc => "List of Erlang applications that shall be rebooted when the EMQX broker joins
the cluster."
})} })}
, {"etc_dir", , {"etc_dir",
sc(string(), sc(string(),

View File

@ -7,7 +7,7 @@ else
SCHEMA="$1" SCHEMA="$1"
fi fi
docker run -d --name langtool "ghcr.io/ieQu1/emqx-schema-validate:0.1.0" docker run -d --name langtool "ghcr.io/iequ1/emqx-schema-validate:0.2.0"
docker exec -i langtool ./emqx_schema_validate - < "${SCHEMA}" docker exec -i langtool ./emqx_schema_validate - < "${SCHEMA}"
success="$?" success="$?"