feat: add listener bind ip config.

This commit is contained in:
DDDHuang 2022-05-31 10:08:21 +08:00
parent 526d8a8200
commit 43b56e82bd
2 changed files with 30 additions and 0 deletions

View File

@ -301,6 +301,17 @@ node.crash_dump = {{ platform_log_dir }}/crash.dump
## vm.args: -kernel net_ticktime Number
## node.dist_net_ticktime = 120
## If the host of an Erlang node has many network interfaces,
## this parameter specifies which one to listen on.
## For the type definition of ip_address(), see inet(3).
##
## See: http://www.erlang.org/doc/man/kernel_app.html
##
## Value: IP Address, [0-255].[0-255].[0-255].[0-255]
## Default: 0.0.0.0
## 0.0.0.0 means all network interfaces.
node.dist_use_interface = 0.0.0.0
## 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.
@ -341,6 +352,8 @@ rpc.async_batch_size = 256
## Defaults to `stateless`.
rpc.port_discovery = stateless
rpc.tcp_server_ip = 0.0.0.0
## TCP port number for RPC server to listen on.
##
## Only takes effect when `rpc.port_discovery` = `manual`.

View File

@ -344,6 +344,23 @@ end}.
hidden
]}.
%% @doc http://www.erlang.org/doc/man/kernel_app.html#net_ticktime
{mapping, "node.dist_use_interface", "kernel.inet_dist_use_interface", [
{commented, "0.0.0.0"},
{datatype, string}
]}.
{translation, "kernel.inet_dist_use_interface",
fun(Conf) ->
Addr = cuttlefish:conf_get("node.dist_use_interface", Conf, "0.0.0.0"),
case inet:parse_address(Addr) of
{ok, IP} ->
IP;
_ ->
error({bad_node_dist_use_interface, Addr})
end
end}.
%% @doc http://www.erlang.org/doc/man/kernel_app.html
{mapping, "node.dist_listen_min", "kernel.inet_dist_listen_min", [
{commented, 6369},