Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Apache Cassandra 3.x - Third Edition

You're reading from  Mastering Apache Cassandra 3.x - Third Edition

Product type Book
Published in Oct 2018
Publisher Packt
ISBN-13 9781789131499
Pages 348 pages
Edition 3rd Edition
Languages
Authors (3):
Aaron Ploetz Aaron Ploetz
Profile icon Aaron Ploetz
Tejaswi Malepati Tejaswi Malepati
Profile icon Tejaswi Malepati
Nishant Neeraj Nishant Neeraj
Profile icon Nishant Neeraj
View More author details

Table of Contents (12) Chapters

Preface 1. Quick Start 2. Cassandra Architecture 3. Effective CQL 4. Configuring a Cluster 5. Performance Tuning 6. Managing a Cluster 7. Monitoring 8. Application Development 9. Integration with Apache Spark 10. References 11. Other Books You May Enjoy

Configuration

At this point, you could start your node with no further configuration. However, it is good to get into the habit of checking and adjusting the properties that are indicated as follows.

cassandra.yaml

It is usually a good idea to rename your cluster. Inside the conf/cassandra.yaml file, specify a new cluster_name property, overwriting the default Test Cluster:

cluster_name: 'PermanentWaves'

The num_tokens property default of 256 has proven to be too high for the newer, 3.x versions of Cassandra. Go ahead and set that to 24:

num_tokens: 24

To enable user security, change the authenticator and authorizer properties (from their defaults) to the following values:

authenticator: PasswordAuthenticator
authorizer: CassandraAuthorizer
Cassandra installs with all security disabled by default. Even if you are not concerned with security on your local system, it makes sense to enable it to get used to working with authentication and authorization from a development perspective.

By default, Cassandra will come up bound to localhost or 127.0.0.1. For your own local development machine, this is probably fine. However, if you want to build a multi-node cluster, you will want to bind to your machine's IP address. For this example, I will use 192.168.0.101. To configure the node to bind to this IP, adjust the listen_address and rpc_address properties:

listen_address: 192.168.0.101
rpc_address: 192.168.0.101

If you set listen_address and rpc_address, you'll also need to adjust your seed list (defaults to 127.0.0.1) as well:

seeds: 192.168.0.101

I will also adjust my endpoint_snitch property to use GossipingPropertyFileSnitch:

endpoint_snitch: GossipingPropertyFileSnitch

cassandra-rackdc.properties

In terms of NoSQL databases, Apache Cassandra handles multi-data center awareness better than any other. To configure this, each node must use GossipingPropertyFileSnitch (as previously mentioned in the preceding cassandra.yaml configuration process) and must have its local data center (and rack) settings defined. Therefore, I will set the dc and rack properties in the conf/cassandra-rackdc.properties file:

dc=ClockworkAngels
rack=R40

You have been reading a chapter from
Mastering Apache Cassandra 3.x - Third Edition
Published in: Oct 2018 Publisher: Packt ISBN-13: 9781789131499
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}