You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Venkata Hari Krishna Nukala <n....@gmail.com> on 2018/04/19 10:52:12 UTC

Detecting data centre failure

Hi,

I am working on a C* cluster which is installed on two data centres. Our
app is in installed on those data centres and they serve life traffic all
the time. Keyspaces are configure with NetworkTopologyStrategy and we are
using LOCAL_QUORUM. Now I have got a case where  stronger consistency is
required across DCs, so would like to switch to EACH_QUORUM.

Suppose if one DC goes down, I would like to fallback to LOCAL_QUORUM so
that our app can continue serving requests and data can be eventually
consistent when it is up.

Now the question is: how to detect if a DC is down programmatically at the
client so that I can switch the consistency level?

Thanks!

Re: Detecting data centre failure

Posted by Jeff Jirsa <jj...@gmail.com>.
Many drivers have a downgrading consistency feature that does it for you, but really you probably want to catch the timeout or unavailable exception and handle it in your app

-- 
Jeff Jirsa


> On Apr 19, 2018, at 5:52 AM, Venkata Hari Krishna Nukala <n....@gmail.com> wrote:
> 
> Hi,
> 
> I am working on a C* cluster which is installed on two data centres. Our app is in installed on those data centres and they serve life traffic all the time. Keyspaces are configure with NetworkTopologyStrategy and we are using LOCAL_QUORUM. Now I have got a case where  stronger consistency is required across DCs, so would like to switch to EACH_QUORUM. 
> 
> Suppose if one DC goes down, I would like to fallback to LOCAL_QUORUM so that our app can continue serving requests and data can be eventually consistent when it is up.
> 
> Now the question is: how to detect if a DC is down programmatically at the client so that I can switch the consistency level?
> 
> Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


Re: Detecting data centre failure

Posted by Niclas Hedhman <ni...@apache.org>.
Also beware of "DC goes down" is not necessarily a total failure. It may be
only a given client that doesn't see the DC, it may be that some hosts in
one DC sees some hosts in the other DC and so on... The black/white "DC
goes down" perception may lead to poor decisions on how to deal with
failures.

Cheers
Niclas

On Thu, Apr 19, 2018 at 6:52 PM, Venkata Hari Krishna Nukala <
n.v.harikrishna.apache@gmail.com> wrote:

> Hi,
>
> I am working on a C* cluster which is installed on two data centres. Our
> app is in installed on those data centres and they serve life traffic all
> the time. Keyspaces are configure with NetworkTopologyStrategy and we are
> using LOCAL_QUORUM. Now I have got a case where  stronger consistency is
> required across DCs, so would like to switch to EACH_QUORUM.
>
> Suppose if one DC goes down, I would like to fallback to LOCAL_QUORUM so
> that our app can continue serving requests and data can be eventually
> consistent when it is up.
>
> Now the question is: how to detect if a DC is down programmatically at the
> client so that I can switch the consistency level?
>
> Thanks!
>



-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org - New Energy for Java