You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Benoit Tellier (Jira)" <se...@james.apache.org> on 2021/04/27 03:19:00 UTC

[jira] [Created] (JAMES-3573) Add a Cassandra configuration option for datacenter

Benoit Tellier created JAMES-3573:
-------------------------------------

             Summary: Add a Cassandra configuration option for datacenter
                 Key: JAMES-3573
                 URL: https://issues.apache.org/jira/browse/JAMES-3573
             Project: James Server
          Issue Type: Improvement
          Components: cassandra
            Reporter: Benoit Tellier


h3. Why

The data-center is not specified in the James Cassandra driver. As such, James do not have an understanding of its locality and might involve Cassandra nodes of the other DCs in its operations despite using LOCAL_SERIAL, LOCAL_QUORUM...

h3. How

add the `local.dc` configuration option in `cassandra.properties` file

{code:java}
local.dc=DC1
{code}

Should result in the cluster builder doing:

{code:java}
Cluster.Builder clusterBuilder = Cluster.builder()
    .withoutJMXReporting()
    .withLoadBalancingPolicy(new TokenAwarePolicy(DCAwareRoundRobinPolicy.builder()
        .withLocalDc("DC1")
        .build()));
{code}

Note that this is the default load-balancing policy:

{code:java}
new TokenAwarePolicy(DCAwareRoundRobinPolicy.builder().build())
{code}

h3. References

See https://stackoverflow.com/questions/48519462/usage-of-the-local-quorum-consistency-level-in-datastax-driver for instance




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org