You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Lu, Boying" <Bo...@emc.com> on 2015/08/26 10:51:16 UTC

How to get the peer's IP address when writing failed

Hi, All,

We have an Cassandra environment with two connected DCs and our consistency level of writing operation is EACH_QUORUM.
So if one DC is down, the write will be failed and we get TokenRangeOfflineException on the client side (we use netfilix java client libraries).

We want to give more detailed information about this failure. e.g. The IP addresses of the broken nodes (on the broken DC in our case).
We checked the TokenRangeOfflineException and its parent class ConnectionException.  The only related method is getHost().
But it returns the IP address of the local node (the node that issues the writing operation) instead of the remote node on the broken DC.

Does anyone know how to get such information when writing failed?

Thanks

Boying


Re: How to get the peer's IP address when writing failed

Posted by Nate McCall <na...@thelastpickle.com>.
Unfortunately, the addresses/DC of the replicas are not available on the
exception hierarchy within Cassandra.

Fwiw, the DS Java Driver (most native protocol drivers actually) manages
membership dynamically by acting on cluster health events sent back over
the channel by the native transport. Keeping this intelligence down in the
driver makes for significantly less complex cluster management in an
application.

On Wed, Aug 26, 2015 at 3:51 AM, Lu, Boying <Bo...@emc.com> wrote:

> Hi, All,
>
>
>
> We have an Cassandra environment with two connected DCs and our
> consistency level of writing operation is EACH_QUORUM.
>
> So if one DC is down, the write will be failed and we get
> TokenRangeOfflineException on the client side (we use netfilix java client
> libraries).
>
>
>
> We want to give more detailed information about this failure. e.g. The IP
> addresses of the broken nodes (on the broken DC in our case).
>
> We checked the TokenRangeOfflineException and its parent class
> ConnectionException.  The only related method is getHost().
>
> But it returns the IP address of the local node (the node that issues the
> writing operation) instead of the remote node on the broken DC.
>
>
>
> Does anyone know how to get such information when writing failed?
>
>
>
> Thanks
>
>
> Boying
>
>
>



-- 
-----------------
Nate McCall
Austin, TX
@zznate

Co-Founder & Sr. Technical Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com