Page tree

2017-11-09 ApacheCN 开源组织,第二期邀请成员活动,一起走的更远 :

MachineLearning 优酷地址 :

Skip to end of metadata
Go to start of metadata

segments 命令提供了在一个索引分片中关于 segment(段)更低级别的信息。它提供的信息与 _segments endpoint(端点)相似。

% curl 'http://localhost:9200/_cat/segments?v'
index shard prirep ip            segment generation docs.count [...]
test  4     p _0               0          1
test1 2     p _0               0          1
test1 3     p _2               2          1
[...] docs.deleted  size size.memory committed searchable version compound
                 0 2.9kb        7818 false     true       4.10.2  true
                 0 2.9kb        7818 false     true       4.10.2  true
                 0 2.9kb        7818 false     true       4.10.2  true


如果你只希望在一个指定的索引中获取关于 segment 的信息,你可以在 URL 中添加索引名,例如,/_cat/segments/test。当然,也可以像 /_cat/segments/test,test1 这样查询多个索引。

下面的列提供了额外的监控信息 : 

prirepWhether this segment belongs to a primary or replica shard.
ipThe ip address of the segments shard.
segmentA segment name, derived from the segment generation. The name is internally used to generate the file names in the directory of the shard this segment belongs to.
generationThe generation number is incremented with each segment that is written. The name of the segment is derived from this generation number.
docs.countThe number of non-deleted documents that are stored in this segment. Note that these are Lucene documents, so the count will include hidden documents (e.g. from nested types).
docs.deletedThe number of deleted documents that are stored in this segment. It is perfectly fine if this number is greater than 0, space is going to be reclaimed when this segment gets merged.
sizeThe amount of disk space that this segment uses.
size.memorySegments store some data into memory in order to be searchable efficiently. This column shows the number of bytes in memory that are used.
committedWhether the segment has been sync’ed on disk. Segments that are committed would survive a hard reboot. No need to worry in case of false, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start.
searchableTrue if the segment is searchable. A value of false would most likely mean that the segment has been written to disk but no refresh occurred since then to make it searchable.
versionThe version of Lucene that has been used to write this segment.
compoundWhether the segment is stored in a compound file. When true, this means that Lucene merged all files from the segment in a single one in order to save file descriptors.