Skip to Content
Mastering Apache Cassandra 3.x - Third Edition
book

Mastering Apache Cassandra 3.x - Third Edition

by Aaron Ploetz, Tejaswi Malepati
October 2018
Beginner to intermediate content levelBeginner to intermediate
348 pages
10h
English
Packt Publishing
Content preview from Mastering Apache Cassandra 3.x - Third Edition

Multi-data center example

The following example will create the packt_ch3b keyspace, as long as it does not already exist. When a write occurs, two replicas will be written to the ClockworkAngels data center, and three will be written to the PermanentWaves and MovingPictures data centers. Writes will also be sent to the commit log for extra durability:

CREATE KEYSPACE packt_ch3_mdc WITH replication = {'class': 'NetworkTopologyStrategy',  'ClockworkAngels':'2', 'MovingPictures':'3', 'PermanentWaves':'3'} AND durable_writes = true;

Once you have created your keyspace, you can use it to avoid having to keep typing it later. Notice that this will also change your Command Prompt:

cassdba@cqlsh> use packt_ch3 ;cassdba@cqlsh:packt_ch3>
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Apache Cassandra - Second Edition

Mastering Apache Cassandra - Second Edition

Nishant Neeraj

Publisher Resources

ISBN: 9781789131499Supplemental Content