查看每个节点的磁盘使用情况
"/_cat/allocation/{node_id}?v"查看fielddata数据
"/_cat/fielddata", "/_cat/fielddata/{fields}"
fielddata是全加载进入内存,主要用处在排序和聚合字段
fielddata与doc values区别:
4.1 相同点
都要创建正排索引,数据结构类似于列式存储
都是为了可以聚合,排序之类的操作
4.2 不同点
存储索引数据的方式不一样:
fielddata: 内存存储;doc_values: OS Cache+磁盘存储
对应的字段类型不一样
fielddata: 对应的字段类型是text; doc_values:对应的字段类型是keyword
针对的类型,也不一样
field_data主要针对的是分词字段;doc_values针对大是不分词字段
是否开启
fielddata默认不开启;doc_values默认是开启
查看索引的状态
"/_cat/indices/index_name?format=json"
4.查看索引分片恢复的详细消息
"/{index}/_recovery?detailed=true"查看master节点
"/_cat/master"
6.查看es返回错误的全部堆栈
error_trace
/company_meta111/_settings?error_trace=true
7 bm2.5文档 The Probabilistic Relevance Framework: BM25 and Beyond.
https://blog.mimacom.com/bm25-got/
线程池相关命令
查看当前线程池设置大小:/_nodes/thread_pool
查看当前使用线程池情况:/_cat/thread_pool/search?format=json
查看指定节点热线程情况:/_nodes/<node_id>/hot_threads
9.查看某个分片分配原因
/_cluster/allocation/explain
{
"index": "company_meta_v3",
"shard": 6,
"primary": false
}es升级到7.x后,在_search后面加上rest_total_hits_as_int=true参数,可以把totals 在7.x的json改成成6.x的整型
关闭磁盘容量检测
curl -XPUT ip:9200/_cluster/settings -d '{ "transient" : { "cluster.routing.allocation.disk.threshold_enabled" : false } }'自定义es similarty
https://github.com/sdauletau/elasticsearch-simple-similarity
https://github.com/stefansavev/elasticsearch-custom-similarity-example/blob/master/src/main/java/stefansavev/esplugins/OverlapSimilarityProvider.java查看当前正在运行的命令
查询正在运行的task
GET _tasks?detailed=true&actions=*indices:data/read/search
取消任务
POST _tasks/CdoilmnzRVyllc0PbRbB2w:7280/_cancel
- 查看索引的段内存
/_cat/segments/company_risk_info?v&h=shard,segment,size,size.segment&format=json - 拷贝一个分片从一个节点到另外一个节点:POST /_cluster/reroute
{
"commands" : [
{
"allocate_replica" : {
"index" : "test", "shard" : 1,
"node" : "node3"
}
}
]
}
16 查看节点所占内存
/_cat/nodes?v&format=json&h=ip,port,v,m,fdp,mc,mcs,sc,sm,qcm,fm,im,siwm,svmm
- dump es堆内存
获取二进制的head dump文件 jmap -dump:format=b,file=/tmp/es_heap.bin <pid> 其中pid是ES JAVA进程的进程号。
- 添加慢日志
PUT /索引名称/_settings
{
"index.search.slowlog.threshold.query.warn": "1s",
"index.search.slowlog.threshold.query.info": "500ms",
"index.search.slowlog.threshold.query.debug": "300ms",
"index.search.slowlog.threshold.query.trace": "100ms",
"index.search.slowlog.threshold.fetch.warn": "1s",
"index.search.slowlog.threshold.fetch.info": "500ms",
"index.search.slowlog.threshold.fetch.debug": "300ms",
"index.search.slowlog.threshold.fetch.trace": "100ms",
"index.search.slowlog.level": "info"
}
git 修改commit信息
git commit --amend统计指定文件的总大小
du -sk * | grep vector | awk '{sum+=$1} END {print sum}'elasticsearch jdk支持版本图
https://www.elastic.co/cn/support/matrix#matrix_jvm查看各文件大小
ls -alhtarthas以utf-8编码启动
java -Dfile.encoding=UTF-8 -jar arthas-boot.jar查看节点内存
/_cat/nodes?format=json&v&h=id,ip,port,v,master,name,heap.current,heap.percent,heap.max,ram.current,ram.percent,ram.max,fielddata.memory_size,fielddata.evictions,query_cache.memory_size,query_cache.evictions,request_cache.memory_size,request_cache.evictions,request_cache.hit_count,request_cache.miss_count