Find the correct server state from nodes REST API

I need to find the number of Active Servers, Servers Failed Over, Servers Down and Servers Pending form Server nodes REST API or cluster details (/pools/default) API, something similar to cluster overview homepage.

As I understood a node is
Active if ‘clusterMemebrship’ === 'active’
Failed over if ‘clusterMemebrship’ === 'inactiveFailed’
Down if ‘status’ !== 'healthy’
and I think finding Pending nodes are more tricky and it is not enough to find nodes with ‘clusterMembership’ !== ‘active’

could you please let me know if I am on the right track and also guide me how to filter pending nodes?

We are working to document this in a better way. The approach as you’ve listed this above will work.

The current reference is available in the docs: http://docs.couchbase.com/admin/admin/REST/rest-server-nodes.html

Here is a writeup on monitoring Couchbase from the REST API that might be useful http://blog.couchbase.com/monitoring-couchbase-cluster

1 Like