Question

I have a CouchBase cluster running version 2.1 community edition and would like to know how can I monitor the log entries that we see in the CouchBase UI ?

I'v been using the cbstats tool for statistics but I'm more interest to catch cases where the cluster is seeing a node in a up/down state or when a node is leaving the cluster.

I have been having problems with my CouchBase cluster and only discover the issue when I manually login in the UI and see those entries in the logs that a node server has problems or it has corrupted data.

Can anyone help me ?

Thanks in advance, Nicolas.

Was it helpful?

Solution

Couchbase dumps its log files to %Couchbase%\Couchbase\Server\var\lib\couchbase\logs (where you sub-in the directory to your couchbase root) - my first suggestion would be to use a tool such as Logstash to parse the files and insert them into an Elasticsearch database, where you could create a query that would pull this (and any other possible scenario).

If that doesn't work for you, you can query the web API directly for whatever you are looking for. I know it provides cluster stats very easily. The API documentation is located here. If that doesn't give you what you want, maybe use the javascript console in your browser to see what the web query is for your specific piece of information (which I couldn't figure out from your question).

OTHER TIPS

I think the best thing to do would be to wrap the Couchbase nodes api request into a script that can be executed as you wish (cron job or perhaps jenkins).

To get node information on its own you can execute the following http call (insert your username and password for the cluster and the IP of one of the nodes)

curl -u username:password  http://NODE_IP:8091/pools/nodes

This will return a LOT of detailed information about the cluster in terms of disk space and memory allocation etc. What you are interested in is the array of nodes which contains info for each node with the current status (check it out as there are lots more interesting stats such as reblance fails,successes etc).

"status": "healthy",
"otpNode": "ns_1@46.4.81.203",

I was interested in the hot keys in my cluster so I wrote a ruby script which wraps the Couchbase API call, you could easily wrap the request I showed and extract the relevant stats and build custom logic on top of it. Check out my repo if you wanna see how I did it. https://github.com/scalabilitysolved/couchbase-hot-keys

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top