Manu, Looks like it is currently impossible to use custom discovery port with TcpDiscoveryKubernetesIpFinder. This limitation is covered in code of a method org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder#parseAddresses
Feel free to create a Jira issue for an improvement. сб, 25 янв. 2020 г. в 10:31, Manu <maxn...@hotmail.com>: > > Hi! > > We are trying to deploy an ignite cluster(s) into kubernetes and found some > issues. > > Sample deployed topology into kubernetes (we need each ignite server cluster > has different discovery port) > > Ignite Server(s) cluster to store main data (discoPort 49500) > \ > Client App with 2 ignite clients (discoPort 49500, discoPort 48500) to > talk with both clusters > / > Ignite Server(s) cluster to store cached data (discoPort 48500) > > Apparently, client nodes are unable to discover server nodes using > kubernetes IpFinder whether non default discovery port, for example 49500, > is used on server side ignite configuration. > > TcpDiscoverySpi local port configuration is ignored on client mode, so port > 47500 is always used to connect to ignite servers (we don't want to use > forceServerMode=true as it is a deprecated feature and may have negative > performance impact) > > In general seems that any IpFinder implementation that has this behaviour > (not provides server port when registered addresses were returned) will have > same issue. > > Fix suggestion, modify org.apache.ignite.spi.discovery.tcp.ClientImpl > spiStart, apparently this change has no collateral effects: > > Original > @Override public void spiStart(@Nullable String igniteInstanceName) > throws IgniteSpiException { > spi.initLocalNode( > 0, > true); > > Fix > @Override public void spiStart(@Nullable String igniteInstanceName) > throws IgniteSpiException { > // FIX ignored TcpDiscoverySpi local port configuration on client > mode, takes configured one > spi.initLocalNode( > spi.locPort, > true); > > > How to reproduce issue: > > 1. Deploy a server node with tcp discovery kubernetes IpFinder and non > default discovery port 49500 into kubernetes > > 2. Deploy client nodes with tcp discovery kubernetes IpFinder and non > default discovery port 49500 into kubernetes > > 3. You will see on client nodes logs that will try to connect to servers on > port 47500, instead of configured 49500. > > Ignite configuration for both server and client node(s) > [...] > <property name="discoverySpi"> > <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> > <property name="localPort" value="49500" /> > <property name="localPortRange" value="1" /> > <property name="ipFinder"> > > <bean > class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder"> > <property name="shared" value="true" /> > <property name="namespace" value="myNamespace"/> > <property name="serviceName" value="server-node"/> > <property name="masterUrl" > value="https://kubernetes.default.svc.cluster.local:443"/> > <property name="accountToken" > value="/var/run/secrets/kubernetes.io/serviceaccount/token"/> > </bean> > </property> > </bean> > </property> > [...] > > Regards! > > Manu. > > > > > > > -- > Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/ -- Best regards, Ivan Pavlukhin