Cassandra Interview Questions Interview Questions

[Interview Question] – What is nodetool netstats? what is a stream id? How to check when a stream is started and when it is ended?

nodetool netstats – Prints network information about the host.

The output includes the following information:

  • JVM settings
  • Mode – The operational mode of the node: JOINING, LEAVING, NORMAL, DECOMMISSIONED, CLIENT
  • Read repair statistics
  • Attempted – The number of successfully completed read repair operations.
  • Mismatch (blocking) – The number of read repair operations since server restart that blocked a query.
  • Mismatch (background) – The number of read repair operations since server restart performed in the background.
  • Pool name – Information about client read and write requests by thread pool size.
  • Active, pending, and completed number of commands and responses

“Streaming” is a component which handles data (part of SSTable file) exchange among nodes in the cluster.

When you bootstrap a new node, it gets data from existing nodes using streaming. When you run nodetool repair, nodes exchange out-of-sync data using streaming.

we can get the stream id from system.log(/var/log/cassandra/system.log) by grep for the keyword ‘stream’

$ ps -ef|grep -i stream

$ grep -i stream system.log|head

INFO  [RepairJobTask:2] 2019-07-31 07:17:58,717  StreamResultFuture.java:93 - [Stream #d9f1d3b0-b384-11e9-9c0e-b71e006e5d73] Executing streaming plan for Repair  

INFO [RepairJobTask:1] 2019-07-31 07:17:58,742 LocalSyncTask.java:103 - [repair #d9639d70-b384-11e9-9c0e-b71e006e5d73] Performing streaming repair of 5 ranges to and 0 ranges from/111.11.1.111

The same way we can get the details like when a stream is started and when it is ended by grep for the keyword ‘Stream’ from system.log as follows :

# grep -i stream system.log|head

INFO  [RepairJobTask:1] 2019-07-31 07:17:58,744  StreamResultFuture.java:93 - [Stream #da15af60-b384-11e9-9c0e-b71e006e5d73] Executing streaming plan for Repair  

INFO [StreamConnectionEstablisher:2] 2019-07-31 07:17:58,745 StreamSession.java:281 - [Stream #da15af60-b384-11e9-9c0e-b71e006e5d73] Starting streaming to /127.0.0.1

# grep -i stream system.log|tail

INFO  [StreamReceiveTask:3] 2019-08-16 07:29:49,222  StreamResultFuture.java:233 - [Stream #27f788c0-c019-11e9-9c0e-b71e006e5d73] All sessions completed  

INFO [StreamReceiveTask:3] 2019-08-16 07:29:49,222 LocalSyncTask.java:138 - [repair #27ce2ed0-c019-11e9-9c0e-b71e006e5d73] Sync complete using session 27ce2ed0-c019-11e9-9c0e-b71e006e5d73 between /127.0.0.1 and /127.0.0.2 on repair_history

Want to check more about nodetool netstats and Streaming in Cassandra


Review
4

Categories

Categories