Database Reference
In-Depth Information
53.25.29.124=DC2:RAC2
53.34.20.223=DC2:RAC2
53.14.14.209=DC2:RAC2
The last thing you need to ensure is that whatever you name your data centers
in the cassandra-topology.properties file, the names must match the names of
your data centers in the keyspace definition. The corresponding keyspace creation
would have to look like Listing 5.4 .
Listing 5.4 Keyspace Creation for a PropertyFileSnitch-Based Keyspace
Click here to view code image
CREATE KEYSPACE VideoStore
WITH replication = {'class': 'NetworkTopo-
logyStrategy', 'DC1' : 2, 'DC2' : 2}
AND durable_writes = true;
Partitioners
The placement of replicas within a data center is determined by the partitioner. At
its core, the partitioner is just a hashing function for computing the token (aka the
hash) of a row key. Since the location of data within a cluster is determined by its
token, it is ultimately up to the partitioner where the data ends up. Each row has
its own token and is therefore uniquely identifiable. This is why each row must be
able to fit in full on a single node, regardless of what the replication factor for the
data center is.
Once the partitioner for a cluster has been chosen, you need to continue to use
the same partitioner. Unlike compaction strategies, once the partitioner is in place,
it is set for the duration of the cluster. That is not to say that you are not without
options. There are a few possible partitioners you can use. As of Cassandra 1.2,
you will almost always want to use the Murmur3Partitioner. Let's take a look at
what options are available.
 
Search WWH ::




Custom Search