Detecting a Failover Situation
Thu, 01/10/2013 - 10:34
What are the various ways of detecting a failover situation using the existing metrics available from cbstats?
From http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-admin-tasks..., I see that the you can reset an "internal" counter with "curl -i -u cluster-username:cluster-password http://localhost:8091/settings/autoFailover/resetCount". By internal, I believe they really do mean internal and not something that is exposed through cbstats. I've read through the 200(?) stats looking for something that would be an indicator of a failover and I'm not spotting it.
Hello,
You should be able to use the REST API to get some information about your cluster and nodes:
curl -u Administrator:password 127.0.0.1:8091/pools/nodes
will return the list of nodes and some information including:
- URL of each nodes
- status of each node "status": "healthy/unhealthy"
The API are documented here:
http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-admin-resta...
Also you can once you have the list of nodes ping them from your application.
Do you mind explaining what you want to achieve with these API?
Also are you talking/using about Couchbase 2.0 or 1.8?
Regards
Tug
@tgrall