头图

一、参考

elasticsearch 学习系列目录——更新ing

search log analyzer

二、Opster

2.1 安装运行

es download

kibana download

tar -xzvf elasticsearch-7.12.1-darwin-x86_64.tar.gz
cd elasticsearch-7.12.1/
./bin/elasticsearch

tar -xzvf kibana-7.12.1-darwin-x86_64.tar.gz
cd work/esEnv/kibana-7.12.1-darwin-x86_64
./bin/kibana

2.2 设置慢查询

image.png

PUT kibana_sample_data_logs/_settings
{
  "index.search.slowlog.threshold.query.warn": "100ms",
  "index.search.slowlog.threshold.query.info": "50ms",
  "index.search.slowlog.threshold.query.debug": "10ms",
  "index.search.slowlog.threshold.query.trace": "60ms",
  "index.search.slowlog.threshold.fetch.warn": "100ms",
  "index.search.slowlog.threshold.fetch.info": "50ms",
  "index.search.slowlog.threshold.fetch.debug": "20ms",
  "index.search.slowlog.threshold.fetch.trace": "60ms",
  "index.search.slowlog.level": "debug"
}

接下来,在kibana中模拟查询,产生一些慢查询日志

image.png

2.3 分析慢查询日志

image.png

image.png


一曲广陵散
76 声望21 粉丝

柴米油盐酱醋茶