title: How can I programmatically test whether cassandra is running?
body: <p>I know I can execute <code>sudo service cassandra status</code>, but this only tells me whether the application is running. Immediately after issuing <code>sudo service cassandra start</code>, the status will be "running" but cassandra will not yet be ready to accept requests. My current approach is to grep the log to detect whether cassandra is available for requests, but I think there should be a better and more robust way of doing this. One idea is to issue a <code>cqlsh -e</code> command and see whether an error is returned, but I'm not sure which command would be best to execute here. What's the best way to achieve this?</p>