[
https://issues.apache.org/jira/browse/IGNITE-3221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15327217#comment-15327217
]
Denis Magda commented on IGNITE-3221:
-------------------------------------
[~sebadiaz], thanks for providing the pull-request! Now the things became much
more clear.
In fact you've only predefined the IP address in {{GridTcpRouterConfiguration}}
which is not used by discovery SPI. This leads to the situation that a node
binds to a random network interface. To overcome this you need to set this IP
address in both {{GridTcpRouterConfiguration}} and
{{IgniteConfiguration.setLocalHost("ip_address_to_bind_to")}}.
Please give it a try and let me know if it works for. If it still doesn't work
please attach full logs and configuration you use.
In regards to your modifications I'm not sure they are needed because
{{InetAddress.getByName}} should work well with plain IP address. The following
is take from the documentation of the method - "If a literal IP address is
supplied, only the validity of the address format is checked."
> Bad ip used , when fixed ip in hostname
> ---------------------------------------
>
> Key: IGNITE-3221
> URL: https://issues.apache.org/jira/browse/IGNITE-3221
> Project: Ignite
> Issue Type: Bug
> Reporter: sebastien diaz
> Assignee: Denis Magda
> Labels: community
>
> Hello
> My machine have certainly a bad dns resolve issue (docker+swarm,network and
> compose) but I fix the ip directly at the place of the hostname.
> Unfortunately TcpDiscoveryNode mark a different socker ip
> Example host=40.1.0.23 -> socketAddress=104.239.213.7 :
> TcpDiscoveryNode [id=54b73d98-e702-4660-957a-61d065003078, addrs=[40.1.0.23],
> sockAddrs=[44de9a1e9afe/104.239.213.7:47500, /40.1.0.23:47500]
> The code apparently in casuse should be :
> public static InetAddress resolveLocalHost(@Nullable String hostName) throws
> IOException {
> return F.isEmpty(hostName) ?
> // Should default to InetAddress#anyLocalAddress which is
> package-private.
> new InetSocketAddress(0).getAddress() :
> InetAddress.getByName(hostName);
> }
> In my issue it will preferable to not use the function
> InetAddress.getByName
> but to use something as
> InetAddress.getByAddress(ipAddr);
> thanks
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)