转载:https://yq.aliyun.com/ziliao/431603
elasticsearch 使用 命令 查看 节点,索引 等 占用内存情况
具体细节 参考官网文档 参考文档
https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html
https://www.elastic.co/blog/elasticsearch-command-line-debugging-with-cat
// 查看 _cat 所有支持参数
curl localhost:9200/_cat
// 查看集群状态
curl localhost:9200/_cat/health
//查看 索引占用内存情况
/_cat/segments
查看所有支持的参数
curl -XGET 'localhost:9200/_cat/segments?help'
index | i,idx | index name
shard | s,sh | shard name
prirep | p,pr,primaryOrReplica | primary or replica
ip | | ip of node where it lives
id | | unique id of node where it lives
segment | seg | segment name
generation | g,gen | segment generation
docs.count | dc,docsCount | number of docs in segment
docs.deleted | dd,docsDeleted | number of deleted docs in segment
size | si | segment size in bytes
size.memory | sm,sizeMemory | segment memory in bytes
committed | ic,isCommitted | is segment committed
searchable | is,isSearchable | is segment searched
version | v,ver | version
compound | ico,isCompound | is segment compound
// 查看 索引 fenci 的占用内存情况 sm
curl -XGET 'localhost:9200/_cat/segments/fenci?v&h=si,sm'
// 查看所有索引占用情况
curl -XGET 'localhost:9200/_cat/segments?v&h=si,sm'
// 查看nodes 节点情况
pid | p | process id
host | h | host name
ip | i | ip address
port | po | bound transport port
version | v | es version
build | b | es build hash
jdk | j | jdk version
disk.avail | d,disk,diskAvail | available disk space
heap.current | hc,heapCurrent | used heap
heap.percent | hp,heapPercent | used heap ratio
heap.max | hm,heapMax | max configured heap
ram.current | rc,ramCurrent | used machine memory
ram.percent | rp,ramPercent | used machine memory ratio
ram.max | rm,ramMax | total machine memory
file_desc.current | fdc,fileDescriptorCurrent | used file descriptors
file_desc.percent | fdp,fileDescriptorPercent | used file descriptor ratio
file_desc.max | fdm,fileDescriptorMax | max file descriptors
cpu | cpu | recent cpu usage
load | l | most recent load avg
uptime | u | node uptime
node.role | r,role,dc,nodeRole | d:data node, c:client node
master | m | m:master-eligible, *:current master
name | n | node name
completion.size | cs,completionSize | size of completion
fielddata.memory_size | fm,fielddataMemory | used fielddata cache
fielddata.evictions | fe,fielddataEvictions | fielddata evictions
query_cache.memory_size | qcm,queryCacheMemory | used query cache
query_cache.evictions | qce,queryCacheEvictions | query cache evictions
request_cache.memory_size | rcm,requestCacheMemory | used request cache
request_cache.evictions | rce,requestCacheEvictions | request cache evictions
request_cache.hit_count | rchc,requestCacheHitCount | request cache hit counts
request_cache.miss_count | rcmc,requestCacheMissCount | request cache miss counts
flush.total | ft,flushTotal | number of flushes
flush.total_time | ftt,flushTotalTime | time spent in flush
get.current | gc,getCurrent | number of current get ops
get.time | gti,getTime | time spent in get
get.total | gto,getTotal | number of get ops
get.exists_time | geti,getExistsTime | time spent in successful gets
get.exists_total | geto,getExistsTotal | number of successful gets
get.missing_time | gmti,getMissingTime | time spent in failed gets
get.missing_total | gmto,getMissingTotal | number of failed gets
indexing.delete_current | idc,indexingDeleteCurrent | number of current deletions
indexing.delete_time | idti,indexingDeleteTime | time spent in deletions
indexing.delete_total | idto,indexingDeleteTotal | number of delete ops
indexing.index_current | iic,indexingIndexCurrent | number of current indexing ops
indexing.index_time | iiti,indexingIndexTime | time spent in indexing
indexing.index_total | iito,indexingIndexTotal | number of indexing ops
indexing.index_failed | iif,indexingIndexFailed | number of failed indexing ops
merges.current | mc,mergesCurrent | number of current merges
merges.current_docs | mcd,mergesCurrentDocs | number of current merging docs
merges.current_size | mcs,mergesCurrentSize | size of current merges
merges.total | mt,mergesTotal | number of completed merge ops
merges.total_docs | mtd,mergesTotalDocs | docs merged
merges.total_size | mts,mergesTotalSize | size merged
merges.total_time | mtt,mergesTotalTime | time spent in merges
percolate.current | pc,percolateCurrent | number of current percolations
percolate.memory_size | pm,percolateMemory | memory used by percolations
percolate.queries | pq,percolateQueries | number of registered percolation queries
percolate.time | pti,percolateTime | time spent percolating
percolate.total | pto,percolateTotal | total percolations
refresh.total | rto,refreshTotal | total refreshes
refresh.time | rti,refreshTime | time spent in refreshes
script.compilations | scrcc,scriptCompilations | script compilations
script.cache_evictions | scrce,scriptCacheEvictions | script cache evictions
search.fetch_current | sfc,searchFetchCurrent | current fetch phase ops
100 15624 100 15624 0 0 953k 0 --:--:-- --:--:-- --:--:-- 14.9M_time | sfti,searchFetchTime | time spent in fetch phase
search.fetch_total | sfto,searchFetchTotal | total fetch ops
search.open_contexts | so,searchOpenContexts | open search contexts
search.query_current | sqc,searchQueryCurrent | current query phase ops
search.query_time | sqti,searchQueryTime | time spent in query phase
search.query_total | sqto,searchQueryTotal | total query phase ops
search.scroll_current | scc,searchScrollCurrent | open scroll contexts
search.scroll_time | scti,searchScrollTime | time scroll contexts held open
search.scroll_total | scto,searchScrollTotal | completed scroll contexts
segments.count | sc,segmentsCount | number of segments
segments.memory | sm,segmentsMemory | memory used by segments
segments.index_writer_memory | siwm,segmentsIndexWriterMemory | memory used by index writer
segments.index_writer_max_memory | siwmx,segmentsIndexWriterMaxMemory | maximum memory index writer may use before it must write buffered documents to a new segment
segments.version_map_memory | svmm,segmentsVersionMapMemory | memory used by version map
segments.fixed_bitset_memory | sfbm,fixedBitsetMemory | memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields
suggest.current | suc,suggestCurrent | number of current suggest ops
suggest.time | suti,suggestTime | time spend in suggest
suggest.total | suto,suggestTotal | number of suggest ops
查看节点 使用情况
curl -s 'localhost:9200/_cat/nodes?h=name,fm,fcm,sm,qcm,im&v'
fielddata.memory_size (fm), // 字段缓存占用内存
filter_cache.memory_size (fcm) // 过滤语句缓存占用内存
segments.memory (sm) // 每个分片包含的断 占用内存
curl -XGET 'localhost:9200/_cat/nodes?v&h=id,host,name,sm'
curl -XGET 127.0.0.1:9200/_cat/segments/subject_v2?v&h=shard,segment,size,size.memory
以上是elasticsearch cat 命令查看 占用内存情况的全部内容,在云栖社区的博客、问答、云栖号、人物、课程等栏目也有elasticsearch cat 命令查看 占用内存情况的相关内容,欢迎继续使用右上角搜索按钮进行搜索elasticsearch ,以便于您获取更多的相关知识。