curl -X GET "localhost:9200/_cluster/health?pretty"The status field shows the cluster health. 'green' means everything is fine. 'yellow' means some replicas are not allocated. 'red' means some primary shards are missing.
/_nodes/stats API in infrastructure monitoring?The /_nodes/stats API provides detailed metrics about each node's resource usage, which is essential for monitoring infrastructure health.
curl -X GET "localhost:9200/_cluster/health?pretty" and see the status is 'yellow'. What is the most likely cause?A 'yellow' status means primary shards are fine but some replicas are missing, which can happen if there are not enough nodes for replicas.
First, you get disk stats from the API, then parse them, set alerts if needed, and regularly review to maintain health.
Best practice is to automate alerts for node availability and cluster health changes to react quickly to failures.
