Merge pull request #8113 from DDDHuang/export_ip_config
Add listening port to erlang node distribution
This commit is contained in:
commit
a8b74c10f2
|
@ -301,6 +301,17 @@ node.crash_dump = {{ platform_log_dir }}/crash.dump
|
||||||
## vm.args: -kernel net_ticktime Number
|
## vm.args: -kernel net_ticktime Number
|
||||||
## node.dist_net_ticktime = 120
|
## 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.
|
## 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
|
||||||
## for nodes’ communication should be allowed.
|
## for nodes’ communication should be allowed.
|
||||||
|
@ -341,6 +352,17 @@ rpc.async_batch_size = 256
|
||||||
## Defaults to `stateless`.
|
## Defaults to `stateless`.
|
||||||
rpc.port_discovery = stateless
|
rpc.port_discovery = stateless
|
||||||
|
|
||||||
|
## If the host of an Erlang node has many network interfaces,
|
||||||
|
## this parameter specifies which one for RPC server 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.
|
||||||
|
#rpc.tcp_server_ip = 0.0.0.0
|
||||||
|
|
||||||
## TCP port number for RPC server to listen on.
|
## TCP port number for RPC server to listen on.
|
||||||
##
|
##
|
||||||
## Only takes effect when `rpc.port_discovery` = `manual`.
|
## Only takes effect when `rpc.port_discovery` = `manual`.
|
||||||
|
|
|
@ -344,6 +344,23 @@ end}.
|
||||||
hidden
|
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
|
%% @doc http://www.erlang.org/doc/man/kernel_app.html
|
||||||
{mapping, "node.dist_listen_min", "kernel.inet_dist_listen_min", [
|
{mapping, "node.dist_listen_min", "kernel.inet_dist_listen_min", [
|
||||||
{commented, 6369},
|
{commented, 6369},
|
||||||
|
@ -389,6 +406,23 @@ end}.
|
||||||
{datatype, integer}
|
{datatype, integer}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
%% RPC server, network interface.
|
||||||
|
{mapping, "rpc.tcp_server_ip", "gen_rpc.socket_ip", [
|
||||||
|
{default, "0.0.0.0"},
|
||||||
|
{datatype, string}
|
||||||
|
]}.
|
||||||
|
|
||||||
|
{translation, "gen_rpc.socket_ip",
|
||||||
|
fun(Conf) ->
|
||||||
|
Addr = cuttlefish:conf_get("rpc.tcp_server_ip", Conf, "0.0.0.0"),
|
||||||
|
case inet:parse_address(Addr) of
|
||||||
|
{ok, IP} ->
|
||||||
|
IP;
|
||||||
|
_ ->
|
||||||
|
error({bad_gen_rpc_socket_ip, Addr})
|
||||||
|
end
|
||||||
|
end}.
|
||||||
|
|
||||||
%% Number of tcp connections when connecting to RPC server
|
%% Number of tcp connections when connecting to RPC server
|
||||||
{mapping, "rpc.tcp_client_num", "gen_rpc.tcp_client_num", [
|
{mapping, "rpc.tcp_client_num", "gen_rpc.tcp_client_num", [
|
||||||
{default, 0},
|
{default, 0},
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}}
|
, {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}}
|
||||||
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.5"}}}
|
, {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.5"}}}
|
||||||
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.1.10"}}}
|
, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.1.10"}}}
|
||||||
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}}
|
, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.2"}}}
|
||||||
, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.3.6"}}}
|
, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.3.6"}}}
|
||||||
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.7"}}}
|
, {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.7"}}}
|
||||||
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.2"}}}
|
, {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.2"}}}
|
||||||
|
|
Loading…
Reference in New Issue