Sunday, March 30, 2014

Intro to Elasticsearch and New Features in version 1.0.x (Cat API)

These are the notes from my presentation: http://www.meetup.com/Elasticsearch-Philadelphia/events/164506092/

http://youtu.be/6Idi13rQx1o?t=38m40s

The cat API provides simple ways to monitor your cluster without needed to parse JSON

$ curl 'localhost:9200/_cat/nodes?h=ip,port,heapPercent,name'
127.0.0.1 9300 4 Red Wolf

$ curl 'localhost:9200/_cat/shards'
philly_energy          4 p STARTED    64 97.5kb 127.0.0.1 Red Wolf
philly_energy          4 r UNASSIGNED                             
philly_energy          0 p STARTED    51 79.3kb 127.0.0.1 Red Wolf
philly_energy          0 r UNASSIGNED                             
philly_energy          3 p STARTED    42   65kb 127.0.0.1 Red Wolf
philly_energy          3 r UNASSIGNED                             
philly_energy          1 p STARTED    54 83.6kb 127.0.0.1 Red Wolf
philly_energy          1 r UNASSIGNED                             
philly_energy          2 p STARTED    48   75kb 127.0.0.1 Red Wolf
philly_energy          2 r UNASSIGNED                             
park_maintenance       2 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance       2 r UNASSIGNED                             
park_maintenance       0 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance       0 r UNASSIGNED                             
park_maintenance       3 p STARTED     4  3.4kb 127.0.0.1 Red Wolf
park_maintenance       3 r UNASSIGNED                             
park_maintenance       1 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance       1 r UNASSIGNED                             
park_maintenance       4 p STARTED     4  3.4kb 127.0.0.1 Red Wolf
park_maintenance       4 r UNASSIGNED                             
park_maintenance_plain 2 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance_plain 2 r UNASSIGNED                             
park_maintenance_plain 0 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance_plain 0 r UNASSIGNED                             
park_maintenance_plain 3 p STARTED     1  3.2kb 127.0.0.1 Red Wolf
park_maintenance_plain 3 r UNASSIGNED                             
park_maintenance_plain 1 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance_plain 1 r UNASSIGNED                             
park_maintenance_plain 4 p STARTED     1  3.2kb 127.0.0.1 Red Wolf
park_maintenance_plain 4 r UNASSIGNED      

Given the format of the cat api it makes it grep friendly

$ curl 'localhost:9200/_cat/shards' | grep park
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2040  100  2040    0     0   131k      0 --:--:-- --:--:-- --:--:--  142k
park_maintenance       2 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance       2 r UNASSIGNED                             
park_maintenance       0 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance       0 r UNASSIGNED                             
park_maintenance       3 p STARTED     4  3.4kb 127.0.0.1 Red Wolf
park_maintenance       3 r UNASSIGNED                             
park_maintenance       1 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance       1 r UNASSIGNED                             
park_maintenance       4 p STARTED     4  3.4kb 127.0.0.1 Red Wolf
park_maintenance       4 r UNASSIGNED                             
park_maintenance_plain 2 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance_plain 2 r UNASSIGNED                             
park_maintenance_plain 0 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance_plain 0 r UNASSIGNED                             
park_maintenance_plain 3 p STARTED     1  3.2kb 127.0.0.1 Red Wolf
park_maintenance_plain 3 r UNASSIGNED                             
park_maintenance_plain 1 p STARTED     0    99b 127.0.0.1 Red Wolf
park_maintenance_plain 1 r UNASSIGNED                             
park_maintenance_plain 4 p STARTED     1  3.2kb 127.0.0.1 Red Wolf
park_maintenance_plain 4 r UNASSIGNED      

No comments:

Post a Comment