Re: Best way to get Cassandra status in Bash

2016-01-07 Thread Giovanni Usai
Hello, thanks a lot! The solution proposed by Gerard works perfectly. This is the snippet of what I have done: echo "Checking if Cassandra is up and running ..." # Try to connect on Cassandra's JMX port 7199 nc -z localhost 7199 nc_return=$? # Try to connect on Cassandra CQL

Re: Best way to get Cassandra status in Bash

2016-01-05 Thread Giovanni Usai
Hello, thanks to everyone for the fast replies! Unfortunately, since yesterday afternoon I have been assigned to a more urgent task, so I will implement the solutions you proposed in the spare time and I will let you know the outcomes asap (hopefully in few weeks). Thanks a lot again! Best

Re: Best way to get Cassandra status in Bash

2016-01-05 Thread Stephen Baynes
I did something like this in Perl. What you want to know is will the server respond to CQL, then it is ready to use. The Bash equivalent of what I did would be to use: cqlsh < /dev/null if $? ... Stephen On 4 January 2016 at 15:56, Giovanni Usai wrote: > Hello Gerard, > thanks for your reply

Re: Best way to get Cassandra status in Bash

2016-01-04 Thread Gerard Maas
Hi Giovanni, You could use netcat (nc) to test that the cassandra port is up and use a timeout to decide when to take an action nc -z localhost 9160 check for the exit code to decide what action to take. -kr, Gerard. On Mon, Jan 4, 2016 at 4:56 PM, Giovanni Usai wrote: > Hello Gerard, > tha

Re: Best way to get Cassandra status in Bash

2016-01-04 Thread Giovanni Usai
Hello Gerard, thanks for your reply. It seems nodetool works only when the cluster is up and running. In case of a bad startup of Cassandra, if I run "nodetool status" I get one of these 2 errors: 1) error: No nodes present in the cluster. Has this node finished starting up? -- StackTrace --

Re: Best way to get Cassandra status in Bash

2016-01-04 Thread Gerard Maas
(Hit enter too fast) In particular, `nodetool status` will give you a summary of the status of the cluster. See the documentation for the parameters it takes. -kr, Gerard. On Mon, Jan 4, 2016 at 3:49 PM, Gerard Maas wrote: > I think you are looking for the nodetool utility: > https://docs.data

Re: Best way to get Cassandra status in Bash

2016-01-04 Thread Gerard Maas
I think you are looking for the nodetool utility: https://docs.datastax.com/en/cassandra/2.1/cassandra/tools/toolsNodetool_r.html On Mon, Jan 4, 2016 at 1:47 PM, Giovanni Usai wrote: > Hello, > I would gladly welcome the help of the community on the following issue I > am having while starting C

Best way to get Cassandra status in Bash

2016-01-04 Thread Giovanni Usai
Hello, I would gladly welcome the help of the community on the following issue I am having while starting Cassandra. I am starting Cassandra by a Bash script in this way: - $CASSANDRA_HOME/bin/cassandra -p $CASSANDRA_PID_FILE and then, I submit some updates via - $CASSANDRA_HOME/bin/cqlsh -f