CASSANDRA Installation and Configuration 2 — Questions and Answers
Question 1: What does the 'num_tokens' setting control in cassandra.yaml?
- The number of authentication tokens per user
- The number of virtual nodes (token ranges) assigned to this node (Correct answer)
- The number of concurrent reads allowed
- The maximum number of SSTables
Correct answer: The number of virtual nodes (token ranges) assigned to this node
num_tokens sets how many virtual node token ranges are assigned to this physical node, with higher values improving load balance.
Question 2: How do you enable authentication in Cassandra?
- Set authenticator: AllowAllAuthenticator in cassandra.yaml
- Set authenticator: PasswordAuthenticator in cassandra.yaml (Correct answer)
- Create a superuser via cqlsh only
- Enable TLS in cassandra-env.sh
Correct answer: Set authenticator: PasswordAuthenticator in cassandra.yaml
Setting authenticator to PasswordAuthenticator in cassandra.yaml enables username/password authentication using the system_auth keyspace.
Question 3: What does the 'endpoint_snitch' configuration control in Cassandra?
- Network traffic encryption
- How Cassandra determines the topology (rack/DC) of nodes for replica placement (Correct answer)
- The gossip heartbeat interval
- The CQL protocol version
Correct answer: How Cassandra determines the topology (rack/DC) of nodes for replica placement
The endpoint_snitch tells Cassandra how nodes are organized into racks and data centers so it can place replicas intelligently to maximize fault tolerance.
Question 4: Which directory parameter in cassandra.yaml specifies where SSTables are stored on disk?
- commitlog_directory
- data_file_directories (Correct answer)
- saved_caches_directory
- hints_directory
Correct answer: data_file_directories
data_file_directories defines the on-disk path(s) where Cassandra writes SSTable files for all keyspaces and tables.
Question 5: What is the purpose of the 'internode_encryption' setting in cassandra.yaml?
- Encrypts data at rest in SSTables
- Enables TLS encryption for communication between Cassandra nodes (Correct answer)
- Encrypts CommitLog entries
- Enforces CQL over SSL for clients
Correct answer: Enables TLS encryption for communication between Cassandra nodes
internode_encryption controls whether TLS is used to secure gossip and streaming traffic between nodes in the cluster.
Question 6: After changing the replication factor of a keyspace in Cassandra, what must you do to apply the change?
- Restart all nodes
- Run nodetool repair on each node (Correct answer)
- Drop and recreate the keyspace
- Run nodetool flush
Correct answer: Run nodetool repair on each node
Running nodetool repair streams the correct replicas to nodes that should now own additional copies according to the new replication factor.
What does the 'num_tokens' setting control in cassandra.yaml?