I want to be able to configure a thin client node programmatically in C# that performs SQL queries in cache; additionally, this node connects with a cluster started remotely. However, I am receiving errors in both local VS console and in Linux:
Error on local, VS console
Apache.Ignite.Core.Client.IgniteClientException: 'Client connection has failed. Examine InnerException for details'
InnerException
SocketException: An established connection was aborted by the software in your host machine.
Error on remote, Linux
Unknown connection detected (is some other software connecting to this Ignite port? missing SSL configuration on remote node?) [rmtAddr=/[localHost2]]
I was wondering if the issue lies in either my C# code for the thin client configuration or the XML file I'm passing to start the remote cluster.
C# code
namespace ThinClient
{
class Program
{
static void Main(string[] args)
{
var cfg = new IgniteClientConfiguration
{
Endpoints = new[] { "[remoteHost]", "[remoteHost]:47500..47509", "[remoteHost]:10800", "[localHost2]", "[localHost2]:10800"}
};
using (var client = Ignition.StartClient(cfg))
{
var cache = client.GetOrCreateCache<int, Object>("default");
Console.WriteLine(">>> Client node connected.");
}
}
}
}
XML configuration file
<?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 id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<value>[remoteHost]:47500..47509</value>
<value>[localHost1]:47500..47509</value>
<value>[localHost2]:47500..47509</value>
<value>[localHost2]:10800</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</beans>