title: How do I determine whether a Cassandra node was drained?
body: <p>I'd like to know whether a Cassandra node is running or not (I know how to do that part, I can just check whether a <code>java</code> process is running, that's the only one that uses <code>java</code> on that server) and when not running, whether the node was properly drained before it was stopped.</p>
  
  <p>So the question is: How can I determine whether <code>nodetool drain</code> was run against a node which is currently stopped?</p>
  
  <p>It's probably something to do with the commitlogs that should be empty, but I'm not too sure how to check that. I'm looking for a way to do so in the console.</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>As per Pandey's answer, here is how my commitlog files look like:</p>
  
  <p>First the location of commitlogs in the <code>/etc/cassandra/cassandra.yaml</code> file:</p>
  
  <pre><code>commitlog_directory: /var/lib/cassandra/commitlog
  </code></pre>
  
  <p>And the contents of that folder:</p>
  
  <pre><code>alexis@cass1:~$ ls -l /var/lib/cassandra/commitlog
  total 65536
  -rw-r--r-- 1 cassandra cassandra 33554432 Feb 22 17:15 CommitLog-6-1550882527529.log
  -rw-r--r-- 1 cassandra cassandra 33554432 Feb 22 17:15 CommitLog-6-1550882527530.log
  </code></pre>
  
  <p>(1024 × 1024 × 32 = 33554432 — so exactly 32Mb)</p>