Saturday, 21 November 2015

Elasticsearch: Get the statistics of node

Nodes stats api provide detailed information at node level.

GET _nodes/stats
Response like below.

{
   "cluster_name": "cluster_sample",
   "status": "yellow",
   "timed_out": false,
   "number_of_nodes": 1,
   "number_of_data_nodes": 1,
   "active_primary_shards": 6,
   "active_shards": 6,
   "relocating_shards": 0,
   "initializing_shards": 0,
   "unassigned_shards": 6,
   "indices": {
      "books": {
         "status": "yellow",
         "number_of_shards": 5,
         "number_of_replicas": 1,
         "active_primary_shards": 5,
         "active_shards": 5,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 5,
         "shards": {
            "0": {
               "status": "yellow",
               "primary_active": true,
               "active_shards": 1,
               "relocating_shards": 0,
               "initializing_shards": 0,
               "unassigned_shards": 1
            },
            "1": {
               "status": "yellow",
               "primary_active": true,
               "active_shards": 1,
               "relocating_shards": 0,
               "initializing_shards": 0,
               "unassigned_shards": 1
            },
            "2": {
               "status": "yellow",
               "primary_active": true,
               "active_shards": 1,
               "relocating_shards": 0,
               "initializing_shards": 0,
               "unassigned_shards": 1
            },
            "3": {
               "status": "yellow",
               "primary_active": true,
               "active_shards": 1,
               "relocating_shards": 0,
               "initializing_shards": 0,
               "unassigned_shards": 1
            },
            "4": {
               "status": "yellow",
               "primary_active": true,
               "active_shards": 1,
               "relocating_shards": 0,
               "initializing_shards": 0,
               "unassigned_shards": 1
            }
         }
      },
      ".marvel-2015.01.07": {
         "status": "yellow",
         "number_of_shards": 1,
         "number_of_replicas": 1,
         "active_primary_shards": 1,
         "active_shards": 1,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 1,
         "shards": {
            "0": {
               "status": "yellow",
               "primary_active": true,
               "active_shards": 1,
               "relocating_shards": 0,
               "initializing_shards": 0,
               "unassigned_shards": 1
            }
         }
      }
   }
}


Let’s analyze the response from top to bottom.

{
   "cluster_name": "cluster_sample",
   "nodes": {
      "ePNCldqMQomTGyNlpwtwcA": {
         "timestamp": 1420618508888,
         "name": "sample_node",
         "transport_address": "inet[RENT-MIS-LT3016.verse.in/172.16.0.3:9300]",
         "host": "RENT-MIS-LT3016",
         "ip": [
            "inet[RENT-MIS-LT3016.abc.in/172.16.0.3:9300]",
            "NONE"
         ],


"cluster_name": "cluster_sample"
Specifies the cluster name.

Nodes are listed in HashMap kind of structure. "ePNCldqMQomTGyNlpwtwcA" represents key(Unique identifier) for this node. Remaining information related to node name, host details, transport address etc.,

Indices section

"docs": {
 "count": 3340,
    "deleted": 0
},
"store": {
 "size_in_bytes": 10030641,
 "throttle_time_in_millis": 514
}


“docs” section represents how many documents inserted and how many documents removed.

“store” section represents size of all the documents in this node and throttle time.

"indexing": {
 "index_total": 3340,
    "index_time_in_millis": 14038,
    "index_current": 0,
    "delete_total": 0,
    "delete_time_in_millis": 0,
    "delete_current": 0,
    "noop_update_total": 0,
    "is_throttled": false,
    "throttle_time_in_millis": 0
}


Represents total number of documents indexed(It is always increasing, even documents deleted, won’t affect this). Indexing time, total documents deleted, deleted time etc.

"get": {
 "total": 0,
    "time_in_millis": 0,
    "exists_total": 0,
    "exists_time_in_millis": 0,
    "missing_total": 0,
    "missing_time_in_millis": 0,
    "current": 0
}


Shows statistics about get-by-ID statistics.

"search": {
   "open_contexts": 0,
    "query_total": 20,
    "query_time_in_millis": 365,
    "query_current": 0,
    "fetch_total": 20,
    "fetch_time_in_millis": 84,
    "fetch_current": 0
}

Describes the number of active searches (open_contexts), number of queries in total, total time taken for all queries, fetch time etc.    
merges": {
    "current": 0,
    "current_docs": 0,
    "current_size_in_bytes": 0,
    "total": 76,
    "total_time_in_millis": 45940,
    "total_docs": 129138,
 "total_size_in_bytes": 301162359
}


merges contanis information about total Lucene segement merges. It specifies number of merges that are currently active, the number of docs involved etc.

"filter_cache": {
 "memory_size_in_bytes": 0,
    "evictions": 0
}


filter_cache indicates total amount of memory used by filter cached bitsets and number of times a filter is evicted.

"id_cache": {
 "memory_size_in_bytes": 0
}


The id cache loads the ids of all documents. It shows the usage by parent/child mappings.

"fielddata": {
    "memory_size_in_bytes": 0,
    "evictions": 0
}


To make sorting efficient, elastic search copies all values for the field into one place, this place is called field data. “fielddata” specifies amount of memory used by fielddata.





Prevoius                                                 Next                                                 Home

No comments:

Post a Comment