Book Image

Cassandra High Performance Cookbook

By : Edward Capriolo
Book Image

Cassandra High Performance Cookbook

By: Edward Capriolo

Overview of this book

<p>Apache Cassandra is a fault-tolerant, distributed data store which offers linear scalability allowing it to be a storage platform for large high volume websites. <br /><br />This book provides detailed recipes that describe how to use the features of Cassandra and improve its performance. Recipes cover topics ranging from setting up Cassandra for the first time to complex multiple data center installations. The recipe format presents the information in a concise actionable form.<br /><br />The book describes in detail how features of Cassandra can be tuned and what the possible effects of tuning can be. Recipes include how to access data stored in Cassandra and use third party tools to help you out. The book also describes how to monitor and do capacity planning to ensure it is performing at a high level. Towards the end, it takes you through the use of libraries and third party applications with Cassandra and Cassandra integration with Hadoop.</p>
Table of Contents (20 chapters)
Cassandra High Performance Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Changing the consistency level of the CLI


The Cassandra data mode stores data across many nodes and data centers. When operating on data, users choose the consistency level of the operation per requests. The default consistency level used by the CLI is ONE. This recipe shows how to use the consistencylevel keyword to change consistency level.

How to do it...

  1. Use the consistencylevel statement to change the consistency level:

    [default@ks33] consistencylevel as QUORUM;
    Consistency level is set to 'QUORUM'.
    
  2. After changing the level, do set, get, and list operations as normal:

    [default@testkeyspace] get cars2['mynewcar'];            
    => (column=make, value=ford, timestamp=1298580528208000)
    => (column=weight, value=2000, timestamp=1298580306095000)
    Returned 2 results.
    

How it works...

Changing the consistency level only affects the current CLI session. Doing this is helpful when trying to troubleshoot errors that users may be reporting. Consistency level ONE is forgiving in that write or read...