You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Wolfgang Meyerle <wo...@googlemail.com> on 2020/11/16 09:57:18 UTC
Thin Client connection not working...
Hi,
I tried using the cpp thin client example from the Apache ignite site to
create a small thin client connection example to one of the running
Apache Ignite cluster nodes.
However it doesn't work and I'm out of a clue.
I added the following bean to my persistence configuration file:
<bean class="org.apache.ignite.configuration.IgniteConfiguration"
id="ignite.cfg">
<property name="clientConnectorConfiguration">
<bean
class="org.apache.ignite.configuration.ClientConnectorConfiguration">
<property name="port" value="10800"/>
</bean>
</property>
</bean>
I restarted the cluster node without any issues.
A netcat localhost 10800 is able to start a connection to the node so I
assume the problem is on the cpp code side.
I used the code sample from the website, but modified the port:
#include <ignite/thin/ignite_client.h>
#include <ignite/thin/ignite_client_configuration.h>
using namespace ignite::thin;
int main(int argc, char**argv)
{
IgniteClientConfiguration cfg;
//Endpoints list format is "<host>[port[..range]][,...]"
cfg.SetEndPoints("127.0.0.1:10800");
IgniteClient client = IgniteClient::Start(cfg);
cache::CacheClient<int32_t, std::string> cacheClient =
client.GetOrCreateCache<int32_t, std::string>("TestCache");
cacheClient.Put(42, "Hello Ignite Thin Client!");
return 0;
}
So what's wrong here?
Regards,
Wolfgang
Re: Thin Client connection not working...
Posted by wo...@googlemail.com.
Unable to connect
Sent from Nine
________________________________
Von: Stephen Darlington <st...@gridgain.com>
Gesendet: Montag, 16. November 2020 12:10
An: user
Betreff: Re: Thin Client connection not working...
Doesn’t work how? Doesn’t compile? Doesn’t connect? Doesn’t create the cache? Is there an error?
> On 16 Nov 2020, at 09:57, Wolfgang Meyerle <wo...@googlemail.com> wrote:
>
> Hi,
>
> I tried using the cpp thin client example from the Apache ignite site to create a small thin client connection example to one of the running Apache Ignite cluster nodes.
>
> However it doesn't work and I'm out of a clue.
>
> I added the following bean to my persistence configuration file:
>
> <bean class="org.apache.ignite.configuration.IgniteConfiguration" id="ignite.cfg">
> <property name="clientConnectorConfiguration">
> <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration">
> <property name="port" value="10800"/>
> </bean>
> </property>
> </bean>
>
>
>
> I restarted the cluster node without any issues.
> A netcat localhost 10800 is able to start a connection to the node so I assume the problem is on the cpp code side.
>
> I used the code sample from the website, but modified the port:
>
> #include <ignite/thin/ignite_client.h>
> #include <ignite/thin/ignite_client_configuration.h>
>
> using namespace ignite::thin;
>
> int main(int argc, char**argv)
> {
> IgniteClientConfiguration cfg;
>
> //Endpoints list format is "<host>[port[..range]][,...]"
> cfg.SetEndPoints("127.0.0.1:10800");
>
> IgniteClient client = IgniteClient::Start(cfg);
>
> cache::CacheClient<int32_t, std::string> cacheClient =
> client.GetOrCreateCache<int32_t, std::string>("TestCache");
>
> cacheClient.Put(42, "Hello Ignite Thin Client!");
>
> return 0;
> }
>
>
> So what's wrong here?
>
>
> Regards,
>
> Wolfgang
Re: Thin Client connection not working...
Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!
I'm pretty sure I had an in-memory node active at the same time.
Regards,
--
Ilya Kasnacheev
ср, 25 нояб. 2020 г. в 09:05, Wolfgang Meyerle <
wolfgang.meyerle@googlemail.com>:
> Seems like you're missing starting up youre ignite server node.
>
> try this:
>
> ./ignite.sh
>
> after the node has started activate the node with
>
> ./control.sh --activate
>
>
> I ran into the same issue...
>
>
> Regards,
>
> Wolfgang
>
> Am 24.11.20 um 4:41 PM schrieb Ilya Kasnacheev:
> >
> > >
> ------------------------------------------------------------------------
> > > *Von:* Stephen Darlington <stephen.darlington@gridgain.com
> > <ma...@gridgain.com>>
>
Re: Thin Client connection not working...
Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!
I have just tried compiling and running this program, and it ran without
any errors (Ubuntu 20.02)
Regards,
--
Ilya Kasnacheev
вт, 17 нояб. 2020 г. в 22:28, Wolfgang Meyerle <
wolfgang.meyerle@googlemail.com>:
> Hi,
>
> sorry for the late reply but it was getting too late yesterday evening...
>
> Below you can find the code from the Apache Ignite Website that I tried
> without successfully getting a connection to the Ignite Server Node...
>
> Just to mention. I had both (the thin client and the server) running on
> the same machine.
> According to the xml file (which I can also attach if asked) I
> configured the port to 10800.
>
> nc localhost 10800 works so I assume the server is listening and the
> problem is the client code from the Apache Ignite Website or my
> configuration...
>
>
>
> #include <ignite/thin/ignite_client.h>
> #include <ignite/thin/ignite_client_configuration.h>
>
> using namespace ignite::thin;
>
> void TestClient()
> {
> IgniteClientConfiguration cfg;
>
> //Endpoints list format is "<host>[port[..range]][,...]"
> cfg.SetEndPoints("localhost:10800");
>
>
> IgniteClient client = IgniteClient::Start(cfg);
>
> cache::CacheClient<int32_t, std::string> cacheClient =
> client.GetOrCreateCache<int32_t, std::string>("TestCache");
>
> cacheClient.Put(42, "Hello Ignite Thin Client!");
> }
>
> int main(int argc, char** argv) {
> TestClient();
> }
>
>
> terminate called after throwing an instance of 'ignite::IgniteError'
> what(): Failed to establish connection with any host.
> 22:18:50: The program has unexpectedly finished.
>
>
>
> Am 16.11.20 um 1:50 PM schrieb wolfgang.meyerle@googlemail.com:
> > I can Post an detailed Error mag tonight
> >
> > Sent from Nine <http://www.9folders.com/>
> > ------------------------------------------------------------------------
> > *Von:* Stephen Darlington <st...@gridgain.com>
> > *Gesendet:* Montag, 16. November 2020 12:10
> > *An:* user
> > *Betreff:* Re: Thin Client connection not working...
> >
> > Doesn’t work how? Doesn’t compile? Doesn’t connect? Doesn’t create the
> > cache? Is there an error?
> >
> > > On 16 Nov 2020, at 09:57, Wolfgang Meyerle
> > <wo...@googlemail.com> wrote:
> > >
> > > Hi,
> > >
> > > I tried using the cpp thin client example from the Apache ignite site
> > to create a small thin client connection example to one of the running
> > Apache Ignite cluster nodes.
> > >
> > > However it doesn't work and I'm out of a clue.
> > >
> > > I added the following bean to my persistence configuration file:
> > >
> > > <bean class="org.apache.ignite.configuration.IgniteConfiguration"
> > id="ignite.cfg">
> > > <property name="clientConnectorConfiguration">
> > > <bean
> > class="org.apache.ignite.configuration.ClientConnectorConfiguration">
> > > <property name="port" value="10800"/>
> > > </bean>
> > > </property>
> > > </bean>
> > >
> > >
> > >
> > > I restarted the cluster node without any issues.
> > > A netcat localhost 10800 is able to start a connection to the node so
> > I assume the problem is on the cpp code side.
> > >
> > > I used the code sample from the website, but modified the port:
> > >
> > > #include <ignite/thin/ignite_client.h>
> > > #include <ignite/thin/ignite_client_configuration.h>
> > >
> > > using namespace ignite::thin;
> > >
> > > int main(int argc, char**argv)
> > > {
> > > IgniteClientConfiguration cfg;
> > >
> > > //Endpoints list format is "<host>[port[..range]][,...]"
> > > cfg.SetEndPoints("127.0.0.1:10800");
> > >
> > > IgniteClient client = IgniteClient::Start(cfg);
> > >
> > > cache::CacheClient<int32_t, std::string> cacheClient =
> > > client.GetOrCreateCache<int32_t, std::string>("TestCache");
> > >
> > > cacheClient.Put(42, "Hello Ignite Thin Client!");
> > >
> > > return 0;
> > > }
> > >
> > >
> > > So what's wrong here?
> > >
> > >
> > > Regards,
> > >
> > > Wolfgang
> >
> >
>
Re: Thin Client connection not working...
Posted by Wolfgang Meyerle <wo...@googlemail.com>.
Hi,
sorry for the late reply but it was getting too late yesterday evening...
Below you can find the code from the Apache Ignite Website that I tried
without successfully getting a connection to the Ignite Server Node...
Just to mention. I had both (the thin client and the server) running on
the same machine.
According to the xml file (which I can also attach if asked) I
configured the port to 10800.
nc localhost 10800 works so I assume the server is listening and the
problem is the client code from the Apache Ignite Website or my
configuration...
#include <ignite/thin/ignite_client.h>
#include <ignite/thin/ignite_client_configuration.h>
using namespace ignite::thin;
void TestClient()
{
IgniteClientConfiguration cfg;
//Endpoints list format is "<host>[port[..range]][,...]"
cfg.SetEndPoints("localhost:10800");
IgniteClient client = IgniteClient::Start(cfg);
cache::CacheClient<int32_t, std::string> cacheClient =
client.GetOrCreateCache<int32_t, std::string>("TestCache");
cacheClient.Put(42, "Hello Ignite Thin Client!");
}
int main(int argc, char** argv) {
TestClient();
}
terminate called after throwing an instance of 'ignite::IgniteError'
what(): Failed to establish connection with any host.
22:18:50: The program has unexpectedly finished.
Am 16.11.20 um 1:50 PM schrieb wolfgang.meyerle@googlemail.com:
> I can Post an detailed Error mag tonight
>
> Sent from Nine <http://www.9folders.com/>
> ------------------------------------------------------------------------
> *Von:* Stephen Darlington <st...@gridgain.com>
> *Gesendet:* Montag, 16. November 2020 12:10
> *An:* user
> *Betreff:* Re: Thin Client connection not working...
>
> Doesn’t work how? Doesn’t compile? Doesn’t connect? Doesn’t create the
> cache? Is there an error?
>
> > On 16 Nov 2020, at 09:57, Wolfgang Meyerle
> <wo...@googlemail.com> wrote:
> >
> > Hi,
> >
> > I tried using the cpp thin client example from the Apache ignite site
> to create a small thin client connection example to one of the running
> Apache Ignite cluster nodes.
> >
> > However it doesn't work and I'm out of a clue.
> >
> > I added the following bean to my persistence configuration file:
> >
> > <bean class="org.apache.ignite.configuration.IgniteConfiguration"
> id="ignite.cfg">
> > <property name="clientConnectorConfiguration">
> > <bean
> class="org.apache.ignite.configuration.ClientConnectorConfiguration">
> > <property name="port" value="10800"/>
> > </bean>
> > </property>
> > </bean>
> >
> >
> >
> > I restarted the cluster node without any issues.
> > A netcat localhost 10800 is able to start a connection to the node so
> I assume the problem is on the cpp code side.
> >
> > I used the code sample from the website, but modified the port:
> >
> > #include <ignite/thin/ignite_client.h>
> > #include <ignite/thin/ignite_client_configuration.h>
> >
> > using namespace ignite::thin;
> >
> > int main(int argc, char**argv)
> > {
> > IgniteClientConfiguration cfg;
> >
> > //Endpoints list format is "<host>[port[..range]][,...]"
> > cfg.SetEndPoints("127.0.0.1:10800");
> >
> > IgniteClient client = IgniteClient::Start(cfg);
> >
> > cache::CacheClient<int32_t, std::string> cacheClient =
> > client.GetOrCreateCache<int32_t, std::string>("TestCache");
> >
> > cacheClient.Put(42, "Hello Ignite Thin Client!");
> >
> > return 0;
> > }
> >
> >
> > So what's wrong here?
> >
> >
> > Regards,
> >
> > Wolfgang
>
>
Re: Thin Client connection not working...
Posted by wo...@googlemail.com.
I can Post an detailed Error mag tonight
Sent from Nine
________________________________
Von: Stephen Darlington <st...@gridgain.com>
Gesendet: Montag, 16. November 2020 12:10
An: user
Betreff: Re: Thin Client connection not working...
Doesn’t work how? Doesn’t compile? Doesn’t connect? Doesn’t create the cache? Is there an error?
> On 16 Nov 2020, at 09:57, Wolfgang Meyerle <wo...@googlemail.com> wrote:
>
> Hi,
>
> I tried using the cpp thin client example from the Apache ignite site to create a small thin client connection example to one of the running Apache Ignite cluster nodes.
>
> However it doesn't work and I'm out of a clue.
>
> I added the following bean to my persistence configuration file:
>
> <bean class="org.apache.ignite.configuration.IgniteConfiguration" id="ignite.cfg">
> <property name="clientConnectorConfiguration">
> <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration">
> <property name="port" value="10800"/>
> </bean>
> </property>
> </bean>
>
>
>
> I restarted the cluster node without any issues.
> A netcat localhost 10800 is able to start a connection to the node so I assume the problem is on the cpp code side.
>
> I used the code sample from the website, but modified the port:
>
> #include <ignite/thin/ignite_client.h>
> #include <ignite/thin/ignite_client_configuration.h>
>
> using namespace ignite::thin;
>
> int main(int argc, char**argv)
> {
> IgniteClientConfiguration cfg;
>
> //Endpoints list format is "<host>[port[..range]][,...]"
> cfg.SetEndPoints("127.0.0.1:10800");
>
> IgniteClient client = IgniteClient::Start(cfg);
>
> cache::CacheClient<int32_t, std::string> cacheClient =
> client.GetOrCreateCache<int32_t, std::string>("TestCache");
>
> cacheClient.Put(42, "Hello Ignite Thin Client!");
>
> return 0;
> }
>
>
> So what's wrong here?
>
>
> Regards,
>
> Wolfgang
Re: Thin Client connection not working...
Posted by Stephen Darlington <st...@gridgain.com>.
Doesn’t work how? Doesn’t compile? Doesn’t connect? Doesn’t create the cache? Is there an error?
> On 16 Nov 2020, at 09:57, Wolfgang Meyerle <wo...@googlemail.com> wrote:
>
> Hi,
>
> I tried using the cpp thin client example from the Apache ignite site to create a small thin client connection example to one of the running Apache Ignite cluster nodes.
>
> However it doesn't work and I'm out of a clue.
>
> I added the following bean to my persistence configuration file:
>
> <bean class="org.apache.ignite.configuration.IgniteConfiguration" id="ignite.cfg">
> <property name="clientConnectorConfiguration">
> <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration">
> <property name="port" value="10800"/>
> </bean>
> </property>
> </bean>
>
>
>
> I restarted the cluster node without any issues.
> A netcat localhost 10800 is able to start a connection to the node so I assume the problem is on the cpp code side.
>
> I used the code sample from the website, but modified the port:
>
> #include <ignite/thin/ignite_client.h>
> #include <ignite/thin/ignite_client_configuration.h>
>
> using namespace ignite::thin;
>
> int main(int argc, char**argv)
> {
> IgniteClientConfiguration cfg;
>
> //Endpoints list format is "<host>[port[..range]][,...]"
> cfg.SetEndPoints("127.0.0.1:10800");
>
> IgniteClient client = IgniteClient::Start(cfg);
>
> cache::CacheClient<int32_t, std::string> cacheClient =
> client.GetOrCreateCache<int32_t, std::string>("TestCache");
>
> cacheClient.Put(42, "Hello Ignite Thin Client!");
>
> return 0;
> }
>
>
> So what's wrong here?
>
>
> Regards,
>
> Wolfgang