You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Alper Tekinalp <al...@evam.com> on 2016/03/17 16:39:54 UTC

Server node info when client disconnects

Hi.

I have a server and a client. I connect server from client with static
ip. When server closed I get client node disconnected event. Is there
easy way that I could know the UUID of the server?

Best regards.

-- 
Alper Tekinalp

Software Developer

Evam Stream Analytics

Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL

Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01

www.evam.com

Re: Server node info when client disconnects

Posted by vkulichenko <va...@gmail.com>.
Hi Alper,

I'm not sure I understand the issue and the fix.

EVT_NODE_LEFT/FAILED and EVT_CLIENT_NODE_DISCONNECTED are different events
that are fired in different situations. For example,
EVT_CLIENT_NODE_DISCONNECTED can happen due to network outage, even without
any server failures. And on the other hand it will not happen if the servers
it was physically connected dies, but the client immediately restores the
connection with the cluster through another server.

Having said that, if you need to know when the server left or failed, you
should listen for EVT_NODE_LEFT/FAILED events. You will receive events for
clients as well, but that's OK, because DiscoveryEvent contains ClusterNode
instance that has all the information about the failed node. I.e., you can
filter out by ClusterNode.isClient() flag.

Makes sense?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Re-Server-node-info-when-client-disconnects-tp3562p3585.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Server node info when client disconnects

Posted by Alper Tekinalp <al...@evam.com>.
Hi again.

I fix my issue by updating discoverySpi for client. When a server
joins cluster i create a new ip finder and add ip of both server1 and
server2. That way when I shutdown server1 client gets node left event
and stay in cluster.

On Fri, Mar 18, 2016 at 11:56 AM, Alper Tekinalp <al...@evam.com> wrote:
> Hi.
>
> If I have 2 servers(serv1, serv2) and a client(cli1) and I connect
> serv1 with static ip configuration, when I close serv1 I get
> EVT_CLIENT_NODE_DISCONNECTED event from client side.
> If I close serv2 instead of serv1 this time I get EVT_NODE_LEFT event.
>
> As I test it seems that I should provide all server ips to client, so
> that client stays in cluster when a server closed.
>
> I have a dynamic environment that server can start and stop and I want
> client to stay in cluser when there are some servers even if that
> servers are started after client connected to cluster. Is there a way
> to accomplish that?
>
> Now it is working as:
> - start server1
> - start client with ip of server1
> - start server2
> - stop server1
> what happens is client disconnects even if there is a server on cluster
>
> What I want is:
> - start server1
> - start client with ip of server1
> - start server2
> - stop server1
> client must stay in cluster and be avare of server2
>
> On Fri, Mar 18, 2016 at 9:35 AM, Alper Tekinalp <al...@evam.com> wrote:
>> Hi Val.
>>
>> When I listen discovery events from server I get EVT_NODE_LEFT events
>> even if client or server disconnects. If I listen events from client
>> side if I have 1 server 1 client when I close server I get
>> EVT_CLIENT_NODE_DISCONNECTED event and that event not contains any
>> information about server node.
>>
>> On Thu, Mar 17, 2016 at 11:10 PM, vkulichenko
>> <va...@gmail.com> wrote:
>>> Hi Alper,
>>>
>>> You can listen for EVT_NODE_FAILED and EVT_NODE_LEFT to get notifications
>>> about nodes that leave topology. Will this work for you?
>>>
>>> -Val
>>>
>>>
>>>
>>> --
>>> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Re-Server-node-info-when-client-disconnects-tp3562p3565.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Alper Tekinalp
>>
>> Software Developer
>>
>> Evam Stream Analytics
>>
>> Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL
>>
>> Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01
>>
>> www.evam.com
>
>
>
> --
> Alper Tekinalp
>
> Software Developer
>
> Evam Stream Analytics
>
> Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL
>
> Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01
>
> www.evam.com



-- 
Alper Tekinalp

Software Developer

Evam Stream Analytics

Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL

Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01

www.evam.com

Re: Server node info when client disconnects

Posted by Alper Tekinalp <al...@evam.com>.
Hi.

If I have 2 servers(serv1, serv2) and a client(cli1) and I connect
serv1 with static ip configuration, when I close serv1 I get
EVT_CLIENT_NODE_DISCONNECTED event from client side.
If I close serv2 instead of serv1 this time I get EVT_NODE_LEFT event.

As I test it seems that I should provide all server ips to client, so
that client stays in cluster when a server closed.

I have a dynamic environment that server can start and stop and I want
client to stay in cluser when there are some servers even if that
servers are started after client connected to cluster. Is there a way
to accomplish that?

Now it is working as:
- start server1
- start client with ip of server1
- start server2
- stop server1
what happens is client disconnects even if there is a server on cluster

What I want is:
- start server1
- start client with ip of server1
- start server2
- stop server1
client must stay in cluster and be avare of server2

On Fri, Mar 18, 2016 at 9:35 AM, Alper Tekinalp <al...@evam.com> wrote:
> Hi Val.
>
> When I listen discovery events from server I get EVT_NODE_LEFT events
> even if client or server disconnects. If I listen events from client
> side if I have 1 server 1 client when I close server I get
> EVT_CLIENT_NODE_DISCONNECTED event and that event not contains any
> information about server node.
>
> On Thu, Mar 17, 2016 at 11:10 PM, vkulichenko
> <va...@gmail.com> wrote:
>> Hi Alper,
>>
>> You can listen for EVT_NODE_FAILED and EVT_NODE_LEFT to get notifications
>> about nodes that leave topology. Will this work for you?
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Re-Server-node-info-when-client-disconnects-tp3562p3565.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>
>
> --
> Alper Tekinalp
>
> Software Developer
>
> Evam Stream Analytics
>
> Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL
>
> Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01
>
> www.evam.com



-- 
Alper Tekinalp

Software Developer

Evam Stream Analytics

Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL

Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01

www.evam.com

Re: Server node info when client disconnects

Posted by Alper Tekinalp <al...@evam.com>.
Hi Val.

When I listen discovery events from server I get EVT_NODE_LEFT events
even if client or server disconnects. If I listen events from client
side if I have 1 server 1 client when I close server I get
EVT_CLIENT_NODE_DISCONNECTED event and that event not contains any
information about server node.

On Thu, Mar 17, 2016 at 11:10 PM, vkulichenko
<va...@gmail.com> wrote:
> Hi Alper,
>
> You can listen for EVT_NODE_FAILED and EVT_NODE_LEFT to get notifications
> about nodes that leave topology. Will this work for you?
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Re-Server-node-info-when-client-disconnects-tp3562p3565.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.



-- 
Alper Tekinalp

Software Developer

Evam Stream Analytics

Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir / İSTANBUL

Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01

www.evam.com

Re: Server node info when client disconnects

Posted by vkulichenko <va...@gmail.com>.
Hi Alper,

You can listen for EVT_NODE_FAILED and EVT_NODE_LEFT to get notifications
about nodes that leave topology. Will this work for you?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Re-Server-node-info-when-client-disconnects-tp3562p3565.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Server node info when client disconnects

Posted by Dmitriy Setrakyan <ds...@apache.org>.
cross-sending this to the user list

On Thu, Mar 17, 2016 at 8:39 AM, Alper Tekinalp <al...@evam.com> wrote:

> Hi.
>
> I have a server and a client. I connect server from client with static
> ip. When server closed I get client node disconnected event. Is there
> easy way that I could know the UUID of the server?
>
> Best regards.
>
> --
> Alper Tekinalp
>
> Software Developer
>
> Evam Stream Analytics
>
> Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir /
> İSTANBUL
>
> Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01
>
> www.evam.com
>

Re: Server node info when client disconnects

Posted by Dmitriy Setrakyan <ds...@apache.org>.
cross-sending this to the user list

On Thu, Mar 17, 2016 at 8:39 AM, Alper Tekinalp <al...@evam.com> wrote:

> Hi.
>
> I have a server and a client. I connect server from client with static
> ip. When server closed I get client node disconnected event. Is there
> easy way that I could know the UUID of the server?
>
> Best regards.
>
> --
> Alper Tekinalp
>
> Software Developer
>
> Evam Stream Analytics
>
> Atatürk Mah.Turgut Özal Bulvarı Gardenya 1 Plaza 42/B K:4 Ataşehir /
> İSTANBUL
>
> Tlf : +90216 688 45 46 Fax : +90216 688 45 47 Gsm:+90 536 222 76 01
>
> www.evam.com
>