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.meye...@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.meye...@googlemail.com:
> > I can Post an detailed Error mag tonight
> >
> > Sent from Nine <http://www.9folders.com/>
> > ------------------------------------------------------------------------
> > *Von:* Stephen Darlington <stephen.darling...@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
> > <wolfgang.meye...@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
> >
> >
>

Reply via email to