chore: check ekka proto dist module type when resolving node address
Follow up to https://github.com/emqx/emqx/pull/11637#discussion_r1334462917 Fixes https://emqx.atlassian.net/browse/EMQX-10944
This commit is contained in:
parent
5e400575e1
commit
806017ef90
|
@ -195,7 +195,8 @@ do_check({Node, #{resolved_ips := [IP | _]} = Plan}) ->
|
|||
node_to_ips(Node) ->
|
||||
NodeBin0 = atom_to_binary(Node),
|
||||
HostOrIP = re:replace(NodeBin0, <<"^.+@">>, <<"">>, [{return, list}]),
|
||||
case inet:gethostbyname(HostOrIP, inet) of
|
||||
AddressType = resolve_dist_address_type(),
|
||||
case inet:gethostbyname(HostOrIP, AddressType) of
|
||||
{ok, #hostent{h_addr_list = AddrList}} ->
|
||||
AddrList;
|
||||
_ ->
|
||||
|
@ -210,3 +211,18 @@ is_tcp_port_open(IP, Port) ->
|
|||
_ ->
|
||||
false
|
||||
end.
|
||||
|
||||
resolve_dist_address_type() ->
|
||||
ProtoDistStr = os:getenv("EKKA_PROTO_DIST_MOD", "inet_tcp"),
|
||||
case ProtoDistStr of
|
||||
"inet_tcp" ->
|
||||
inet;
|
||||
"inet6_tcp" ->
|
||||
inet6;
|
||||
"inet_tls" ->
|
||||
inet;
|
||||
"inet6_tls" ->
|
||||
inet6;
|
||||
_ ->
|
||||
inet
|
||||
end.
|
||||
|
|
|
@ -170,7 +170,7 @@ t_open_ports_check(Config) ->
|
|||
}
|
||||
},
|
||||
erpc:call(Core1, emqx_machine, open_ports_check, []),
|
||||
#{core2 => Core2}
|
||||
#{core2 => Core2, gen_rpc_port => GenRPCPort, ekka_port => EkkaPort}
|
||||
),
|
||||
|
||||
ok.
|
||||
|
|
Loading…
Reference in New Issue