0

I created an AKS and I deployed the Apache Ignite service on it. When I check the pods I can see they are working.

Pods Status

Also, I can get the load balancer IP.

AKS Load Balancer IP

I follow the official instructions of Apache and try to connect Ignite with ThinClient. I share my code and instructions code.

Here is my code:

public void ConnectIgnite()
{
    var cfg = new IgniteClientConfiguration
    {
       Endpoints = new[] { "20.101.12.***:10800" }
    };
    
    var client = Ignition.StartClient(cfg);
}

But my code is getting below errors;

System.AggregateException: 'Failed to establish Ignite thin client connection, examine inner exceptions for details.'

Inner Exception ExtendedSocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

and here is the Apache's instruction code;

ClientConfiguration cfg = new ClientConfiguration().setAddresses("13.86.186.145:10800");
IgniteClient client = Ignition.startClient(cfg);

ClientCache<Integer, String> cache = client.getOrCreateCache("test_cache");

cache.put(1, "first test value");

System.out.println(cache.get(1));

client.close();

Also, here is the official instruction link

I didn't understand what is wrong? Also, The Instruction says I don't need clientid and clientsecret but I don't want to connect without any security but this is completely another issue.

OguzKaanAkyalcin
  • 621
  • 2
  • 8
  • 25

2 Answers2

1

I found what is wrong. Apache's official page says: use below XML for the configuration.

<bean class="org.apache.ignite.configuration.IgniteConfiguration">

    <property name="discoverySpi">
        <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
                <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
                    <constructor-arg>
                        <bean class="org.apache.ignite.kubernetes.configuration.KubernetesConnectionConfiguration">
                            <property name="namespace" value="default" />
                            <property name="serviceName" value="ignite" />
                        </bean>
                    </constructor-arg>
                </bean>
            </property>
        </bean>
    </property>
</bean>

but,

first, that XML needs a beans tag at the top of XML. Also, namespace value and serviceName value are not compatible with apache's official instruction page. If you follow the apache's page for the setup;

you have to use the below values

<property name="namespace" value="ignite" />
<property name="serviceName" value="ignite-service" />

instead of

<property name="namespace" value="default" />
<property name="serviceName" value="ignite" />

end of the changes your XML will look like

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
                        <constructor-arg>
                            <bean class="org.apache.ignite.kubernetes.configuration.KubernetesConnectionConfiguration">
                                <property name="namespace" value="ignite" />
                                <property name="serviceName" value="ignite-service" />
                            </bean>
                        </constructor-arg>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

I changed my configuration XML and restart the pods with below command and It worked.

kubectl -n service rollout restart deployment ignite-cluster
OguzKaanAkyalcin
  • 621
  • 2
  • 8
  • 25
0

Try connecting using 20.101.12.*** address from the outside. Btw, what is 13.86.186.145, why are you trying to connect to it?

An update: Seems like you just copy-pasted it from the docs, you need to replace it with your own values.

Alexandr Shapkin
  • 2,350
  • 1
  • 6
  • 10