You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by ABDumalagan <ad...@scarletmail.rutgers.edu> on 2020/11/09 17:35:15 UTC

Server node started via PuTTY, C# client not able to connect to cluster

I am starting a cluster through another computer via PuTTY, and I was
wondering how to connect a local node started programmatically with C# to
the cluster? 


Right now, I am running into errors with what I have--

I start an ignite server remotely with the script bash
ignite.shC:\..\\..\config\example-test-connection.xml

The XML configuration file looks like this:

<?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">
        <property name="cacheConfiguration">
            <list>
                
                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="default"/>
                    <property name="atomicityMode" value="ATOMIC"/>
                    <property name="backups" value="1"/>
                </bean>
            </list>
        </property>
        
        <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>
                                
                                <value>171.159.66.12:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>


And the program I'm trying to run that creates a client node to connect with
the cluster:

var cfg = new IgniteClientConfiguration
            {
                Endpoints = new[] { "171.159.66.12" }
            };

            try
            {
                using (IIgniteClient client = Ignition.StartClient(cfg))
                {
                    ICacheClient<int, string> cache = client.GetCache<int,
string>("name");
                    cache.Put(1, "Hello World!");
                    Console.WriteLine("Added a value to the cache!");
                }
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Server node started via PuTTY, C# client not able to connect to cluster

Posted by Pavel Tupitsyn <pt...@apache.org>.
What kind of error do you get?
10800 is the default thin client port, are you sure it is open on the
server?

On Mon, Nov 9, 2020 at 8:35 PM ABDumalagan <ad...@scarletmail.rutgers.edu>
wrote:

> I am starting a cluster through another computer via PuTTY, and I was
> wondering how to connect a local node started programmatically with C# to
> the cluster?
>
>
> Right now, I am running into errors with what I have--
>
> I start an ignite server remotely with the script bash
> ignite.shC:\..\\..\config\example-test-connection.xml
>
> The XML configuration file looks like this:
>
> <?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">
>         <property name="cacheConfiguration">
>             <list>
>
>                 <bean
> class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="default"/>
>                     <property name="atomicityMode" value="ATOMIC"/>
>                     <property name="backups" value="1"/>
>                 </bean>
>             </list>
>         </property>
>
>         <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>
>
>                                 <value>171.159.66.12:47500..47509</value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>     </bean>
> </beans>
>
>
> And the program I'm trying to run that creates a client node to connect
> with
> the cluster:
>
> var cfg = new IgniteClientConfiguration
>             {
>                 Endpoints = new[] { "171.159.66.12" }
>             };
>
>             try
>             {
>                 using (IIgniteClient client = Ignition.StartClient(cfg))
>                 {
>                     ICacheClient<int, string> cache = client.GetCache<int,
> string>("name");
>                     cache.Put(1, "Hello World!");
>                     Console.WriteLine("Added a value to the cache!");
>                 }
>             }
>             catch(Exception ex)
>             {
>                 Console.WriteLine(ex);
>             }
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>