indices.asciidoc 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [[cat-indices]]
  2. == cat indices
  3. The `indices` command provides a cross-section of each index. This
  4. information *spans nodes*.
  5. [source,sh]
  6. --------------------------------------------------
  7. % curl 'localhost:9200/_cat/indices/twi*?v'
  8. health status index pri rep docs.count docs.deleted store.size pri.store.size
  9. green open twitter 5 1 11434 0 64mb 32mb
  10. green open twitter2 2 0 2030 0 5.8mb 5.8mb
  11. --------------------------------------------------
  12. We can tell quickly how many shards make up an index, the number of
  13. docs, deleted docs, primary store size, and total store size (all
  14. shards including replicas).
  15. [float]
  16. [[pri-flag]]
  17. === Primaries
  18. The index stats by default will show them for all of an index's
  19. shards, including replicas. A `pri` flag can be supplied to enable
  20. the view of relevant stats in the context of only the primaries.
  21. [float]
  22. [[examples]]
  23. === Examples
  24. Which indices are yellow?
  25. [source,sh]
  26. --------------------------------------------------
  27. % curl localhost:9200/_cat/indices | grep ^yell
  28. yellow open wiki 2 1 6401 1115 151.4mb 151.4mb
  29. yellow open twitter 5 1 11434 0 32mb 32mb
  30. --------------------------------------------------
  31. What's my largest index by disk usage not including replicas?
  32. [source,sh]
  33. --------------------------------------------------
  34. % curl 'localhost:9200/_cat/indices?bytes=b' | sort -rnk8
  35. green open wiki 2 0 6401 1115 158843725 158843725
  36. green open twitter 5 1 11434 0 67155614 33577857
  37. green open twitter2 2 0 2030 0 6125085 6125085
  38. --------------------------------------------------
  39. How many merge operations have the shards for the `wiki` completed?
  40. [source,sh]
  41. --------------------------------------------------
  42. % curl 'localhost:9200/_cat/indices/wiki?pri&v&h=health,index,prirep,docs.count,mt'
  43. health index docs.count mt pri.mt
  44. green wiki 9646 16 16
  45. --------------------------------------------------
  46. How much memory is used per index?
  47. [source,sh]
  48. --------------------------------------------------
  49. % curl 'localhost:9200/_cat/indices?v&h=i,tm'
  50. i tm
  51. wiki 8.1gb
  52. test 30.5kb
  53. user 1.9mb
  54. --------------------------------------------------