
社区日报 第1192期 (2021-02-06)
1.可以将希腊文转成拉丁文的token插件
https://github.com/skroutz/elasticsearch-analysis-greeklish
2.利用grafana监控es
https://github.com/BigDataBoutique/elasticsearch-monitoring
3.spring连接es的几种方式
https://medium.com/better-programming/getting-started-with-elasticsearch-in-java-spring-boot-d981c32b60b
1.可以将希腊文转成拉丁文的token插件
https://github.com/skroutz/elasticsearch-analysis-greeklish
2.利用grafana监控es
https://github.com/BigDataBoutique/elasticsearch-monitoring
3.spring连接es的几种方式
https://medium.com/better-programming/getting-started-with-elasticsearch-in-java-spring-boot-d981c32b60b
收起阅读 »
社区日报 第1191期 (2021-02-05)
https://medium.com/better-prog ... 2b60b
2、Observability:网站 User Experience 监控
https://elasticstack.blog.csdn ... 46386
3、一周之内如何搞定 Elasticsearch,看老外怎么说?(梯子)
https://www.quora.com/I-have-b ... -week
编辑:铭毅天下
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://medium.com/better-prog ... 2b60b
2、Observability:网站 User Experience 监控
https://elasticstack.blog.csdn ... 46386
3、一周之内如何搞定 Elasticsearch,看老外怎么说?(梯子)
https://www.quora.com/I-have-b ... -week
编辑:铭毅天下
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

Observability:网站 User Experience 监控
详细阅读,请参阅 https://elasticstack.blog.csdn ... 46386
详细阅读,请参阅 https://elasticstack.blog.csdn ... 46386 收起阅读 »

社区日报 第1190期 (2021-02-04)
https://www.elastic.co/blog/elastic-license-v2
2.为 Elastic Security 定制 Detection rules
https://elasticstack.blog.csdn ... 84031
3.基于 Elasticsearch 的数据报表方案
https://www.jianshu.com/p/24b4ba3951eb
编辑:金桥
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://www.elastic.co/blog/elastic-license-v2
2.为 Elastic Security 定制 Detection rules
https://elasticstack.blog.csdn ... 84031
3.基于 Elasticsearch 的数据报表方案
https://www.jianshu.com/p/24b4ba3951eb
编辑:金桥
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
收起阅读 »

社区日报 第1189期 (2021-02-3)
https://mp.weixin.qq.com/s/3PihgMYpkSA-jJYFcLwrVg
2.使用 Dorothy 和 Elastic 安全测试您的 Okta 可见性和检测能力
https://www.elastic.co/cn/blog ... rothy
3.将日志数据从Jenkins传输到Kibana
https://blogs.sap.com/2019/04/ ... oard/
编辑:寂寞的烟
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://mp.weixin.qq.com/s/3PihgMYpkSA-jJYFcLwrVg
2.使用 Dorothy 和 Elastic 安全测试您的 Okta 可见性和检测能力
https://www.elastic.co/cn/blog ... rothy
3.将日志数据从Jenkins传输到Kibana
https://blogs.sap.com/2019/04/ ... oard/
编辑:寂寞的烟
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

社区日报 第1188期 (2021-02-02)
https://mp.weixin.qq.com/s/_eS0IndE0p2SYZVwn7TnbA
2.Elasticsearch使用:Routing API
https://cloud.tencent.com/deve ... 82295
3.ElasticSearch入门详解(结合Kibana)
https://www.jianshu.com/p/92e49c18ac96
编辑:叮咚光军
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://mp.weixin.qq.com/s/_eS0IndE0p2SYZVwn7TnbA
2.Elasticsearch使用:Routing API
https://cloud.tencent.com/deve ... 82295
3.ElasticSearch入门详解(结合Kibana)
https://www.jianshu.com/p/92e49c18ac96
编辑:叮咚光军
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

社区日报 第1187期 (2021-02-01)
https://my.oschina.net/LucasZhu/blog/1570733
2.ElasticSearch Machine Learning
https://www.bmc.com/blogs/elas ... ning/
3.使用elasticsearch 进行异常诊断
https://www.invivoo.com/blog/m ... -elk/
编辑:cyberdak
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://my.oschina.net/LucasZhu/blog/1570733
2.ElasticSearch Machine Learning
https://www.bmc.com/blogs/elas ... ning/
3.使用elasticsearch 进行异常诊断
https://www.invivoo.com/blog/m ... -elk/
编辑:cyberdak
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

社区日报 第1186期 (2021-01-31)
https://www.meetup.com/Haystac ... 20872
2.(自备梯子)用于presto的高性能Elasticsearch连接器。
https://blog.bigdataboutique.c ... uvf0w
3.构建SaaS的首选堆栈。
https://www.simplecto.com/dock ... 2021/
编辑:至尊宝
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://www.meetup.com/Haystac ... 20872
2.(自备梯子)用于presto的高性能Elasticsearch连接器。
https://blog.bigdataboutique.c ... uvf0w
3.构建SaaS的首选堆栈。
https://www.simplecto.com/dock ... 2021/
编辑:至尊宝
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

社区日报 第1185期 (2021-01-30)
1.通过配置自定义分析器扩展asciifolding分析器范围
https://stackoverflow.com/questions/44827673/search-with-asciifolding-and-utf-8-characters-in-elasticsearch
2.字段折叠用法示例
https://blog.csdn.net/ctwy291314/article/details/82759215
3.es7.11如何提升date-histogram的聚合速度
https://www.elastic.co/cn/blog/how-we-made-date-histogram-aggregations-faster-than-ever-in-elasticsearch-7-11
1.通过配置自定义分析器扩展asciifolding分析器范围
https://stackoverflow.com/questions/44827673/search-with-asciifolding-and-utf-8-characters-in-elasticsearch
2.字段折叠用法示例
https://blog.csdn.net/ctwy291314/article/details/82759215
3.es7.11如何提升date-histogram的聚合速度
https://www.elastic.co/cn/blog/how-we-made-date-histogram-aggregations-faster-than-ever-in-elasticsearch-7-11
收起阅读 »
社区日报 第1184期 (2021-01-29)
https://elasticstack.blog.csdn ... 67307
2、踩坑日志之elasticSearch
https://mp.weixin.qq.com/s/9TTGQRTFSLJo9-APnNh-SQ
3、Elasticsearch中的相似度评分介绍
https://cloud.tencent.com/developer/news/762466
编辑:铭毅天下
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://elasticstack.blog.csdn ... 67307
2、踩坑日志之elasticSearch
https://mp.weixin.qq.com/s/9TTGQRTFSLJo9-APnNh-SQ
3、Elasticsearch中的相似度评分介绍
https://cloud.tencent.com/developer/news/762466
编辑:铭毅天下
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

Elasticsearch:EQL 入门 - 使用 EQL 检测威胁
详细阅读,请参阅 https://elasticstack.blog.csdn ... 89999
详细阅读,请参阅 https://elasticstack.blog.csdn ... 89999 收起阅读 »

社区日报 第1183期 (2021-01-28)
https://elasticstack.blog.csdn ... 07195
2.提升四倍索引速度的办法
https://elasticsearch.cn/article/14228
3.滴滴Logi日志服务套件
https://blog.csdn.net/changxia ... 26532
编辑:金桥
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup
https://elasticstack.blog.csdn ... 07195
2.提升四倍索引速度的办法
https://elasticsearch.cn/article/14228
3.滴滴Logi日志服务套件
https://blog.csdn.net/changxia ... 26532
编辑:金桥
归档:https://ela.st/cn-daily-all
订阅:https://ela.st/cn-daily-sub
沙龙:https://ela.st/cn-meetup 收起阅读 »

Elasticsearch生态&技术峰会
开源最大的特征就是开放性,云生态则让开源技术更具开放性与创造性,Elastic 与阿里云的合作正是开源与云生态共生共荣的典范。值此合作三周年之际,我们邀请业界资深人士相聚云端,共话云上Elasticsearch生态与技术的未来。
本次峰会邀请了阿里巴巴副总裁/阿里云智能高级研究员贾扬清、Elastic创始人&CEO Shay Banon共话开源与云生态未来发展之路,也汇聚了13位Elasticsearch技术领域资深的专家带来最前沿的技术分享。
活动时间:2021年2月2日
直播地址:https://developer.aliyun.com/t ... c9fkf
开源最大的特征就是开放性,云生态则让开源技术更具开放性与创造性,Elastic 与阿里云的合作正是开源与云生态共生共荣的典范。值此合作三周年之际,我们邀请业界资深人士相聚云端,共话云上Elasticsearch生态与技术的未来。
本次峰会邀请了阿里巴巴副总裁/阿里云智能高级研究员贾扬清、Elastic创始人&CEO Shay Banon共话开源与云生态未来发展之路,也汇聚了13位Elasticsearch技术领域资深的专家带来最前沿的技术分享。
活动时间:2021年2月2日
直播地址:https://developer.aliyun.com/t ... c9fkf
收起阅读 »

如何使用 Ansible自动化部署 Elastic Stack
如果你想了解 ansible 是如何部署 Elastic Stack 的,请阅读系列文章:
如何使用 Ansible自动化部署 Elastic Stack - Overview(一)
如何使用 Ansible自动化部署 Elastic Stack - Elasticsearch (二)
如何使用 Ansible自动化部署 Elastic Stack - Kibana(三)
Elastic:如何使用 Ansible自动化部署 Elastic Stack -Security(四)
如何使用 Ansible自动化部署 Elastic Stack -Metricbeat(五)
如果你想了解 ansible 是如何部署 Elastic Stack 的,请阅读系列文章:
如何使用 Ansible自动化部署 Elastic Stack - Overview(一)
如何使用 Ansible自动化部署 Elastic Stack - Elasticsearch (二)
如何使用 Ansible自动化部署 Elastic Stack - Kibana(三)
Elastic:如何使用 Ansible自动化部署 Elastic Stack -Security(四)
如何使用 Ansible自动化部署 Elastic Stack -Metricbeat(五) 收起阅读 »

四倍索引速度提升, 有点东西
最近看到 INFINI Gateway 新增了一个 bulk_reshuffle filter, 于是便简单地测试一下这个功能。(Gateway 下载地址 以及 参考文档)
测试机器配置
系统 | 处理器 | 内存 |
---|---|---|
Macos | 2 GHz 四核Intel Core i5 | 16 GB |
测试所需软件及版本
- Elasticsearch 7.10
- Kibana 7.10
- INFINI Gateway 最新版本
- Logstash 7.10
- Metricbeat 7.10
本文就省略以上软件的下载和安装步骤了。 另外本文中测试 Elasticsearch 集群含两个节点,每个节点配置内存都为 1GB ,其他参数均为默认。
测试步骤
准备测试数据文件
本文测试数据文件 nginx_mock_log ,文件中每行结构如下:
{"timestamp":1611540661651,"method":"POST","msg":"mock log"}
大概一千多万条
Logstatsh 使用 Input file 模式直接输出数据到 Elasticsearch
编辑 Logstash 配置 test.conf 如下:
input{
file {
path => ["/test/nginx_mock_log"]
type => "file_monitor"
start_position => "beginning"
}
}
output{
elasticsearch {
hosts => ["localhost:9200"]
index => "nginx_mock_log"
http_compression => false
}
}
在 kibana 中创建索引 nginx_mock_log ,将主分片设置为2(为了体现出 Gateway的性能优势, 主分片数应设置大于1), 配置如下:
PUT nginx_mock_log
{
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"host" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"path" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"settings" : {
"number_of_shards" : "2"
}
}
运行 Logstash
/usr/local/logstash/bin/logstash -f test.conf
打开 Kibana Stack Monitorning 查看 Indexing Rate 监控指标如下图:
从图中可以看到索引速率基本保持在4300/s 上下
Logstatsh 使用 Input file 模式输出数据到 Gateway
进入 Kibana 删除索引 nginx_mock_log 并重建
DELETE nginx_mock_log
PUT nginx_mock_log
{
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"host" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"path" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"settings" : {
"number_of_shards" : "2"
}
}
修改 Logstash 配置 test.conf 如下:
input{
file {
path => ["/test/nginx_mock_log"]
type => "file_monitor"
start_position => "beginning"
}
}
output{
elasticsearch {
hosts => ["localhost:8000"]
index => "nginx_mock_log"
http_compression => false
}
}
修改 Gateway 配置文件 gateway.yaml 如下:
path.data: data
path.logs: log
entry:
- name: es_gateway #your gateway endpoint
enabled: true
router: default
network:
binding: localhost:8000
reuse_port: true #you can start multi gateway instance, they share same port, to full utilize system's resources
flow:
- name: bulk_es_test
filter: #comment out any filter sections, like you don't need cache or rate-limiter
- name: bulk_reshuffle
parameters:
elasticsearch: dev
level: node
mode: async
- name: elasticsearch
parameters:
elasticsearch: dev
refresh:
enabled: true
interval: 30s
- name: request_logging
filter:
- name: request_logging
parameters:
queue_name: request_logging
router:
- name: default
default_flow: bulk_es_test
tracing_flow: request_logging
elasticsearch:
- name: dev
enabled: true
endpoint: http://localhost:9200 # if your elasticsearch is using https, your gateway should be listen on as https as well
basic_auth: #used to discovery full cluster nodes, or check elasticsearch's health and versions
username: elastic
password: yV6syH3KLt4DxqMlCyag
discovery: # auto discovery elasticsearch cluster nodes
enabled: true
refresh:
enabled: true
modules:
- name: elastic
enabled: true
elasticsearch: dev
store:
enabled: true
orm:
enabled: true
init_template: true
template_name: ".infini-default1"
index_prefix: "gateway_"
- name: pipeline
enabled: true
runners:
- name: nodes_index
enabled: true
max_go_routine: 2
threshold_in_ms: 0
timeout_in_ms: 5000
pipeline_id: bulk_request_ingest
- name: request_logging_test_name
enabled: true
max_go_routine: 2
threshold_in_ms: 0
timeout_in_ms: 5000
pipeline_id: request_logging_index
pipelines:
- name: bulk_request_ingest
start:
joint: bulk_indexing
enabled: true
parameters:
elasticsearch: "dev"
timeout: "5s"
worker_size: 10
bulk_size_in_mb: 1 #in MB
- name: request_logging_index
start:
joint: json_indexing
enabled: true
parameters:
index_name: "gateway_requests"
elasticsearch: "dev"
input_queue: "request_logging"
timeout: "5s"
worker_size: 10
bulk_size_in_mb: 1 #in MB
queue:
min_msg_size: 1
max_msg_size: 5000000000
max_bytes_per_file: 53687091200
sync_every_records: 100000 # sync by records count
sync_timeout_in_ms: 10000 # sync by time in million seconds
write_chan_buffer: 1000
read_chan_buffer: 1000
以上各配置节点含义,请参考 Gateway 文档
启动 Gateway
./gateway
删除 Logstash data 目录
rm -rf /usr/local/logstash/data
启动 Logstash
/usr/local/logstash/bin/logstash -f test.conf
打开 Kibana Stack Monitorning 查看 Indexing Rate 监控指标如下图:
从上图后半部分可以看到索引速率可以保持在 25000/s 上下(一会儿的功夫,一千多万条数据导入ES完事了)
前面看到 Gateway 配置开启了 request_logging,因此可以在 Kibana Dashboard 里面的 INFINI Gateway Dashboard 查看请求信息,如下图:
注意,上面图中的请求速率是 _bulk 请求的速率,不是索引速率
总结
从测试结果来看,相同环境下,用 Logstash elasticsearch output 输出数据到 Gateway 的方式比 Logstash elasticsearch output 直接到 ES 的方式速率快了4倍,不得不说这速率是真的杠杠的。至于能不能通过参数调优再提升速率呢?大家有兴趣的自己下载测试吧!最后感谢 medcl 大神出品。
最近看到 INFINI Gateway 新增了一个 bulk_reshuffle filter, 于是便简单地测试一下这个功能。(Gateway 下载地址 以及 参考文档)
测试机器配置
系统 | 处理器 | 内存 |
---|---|---|
Macos | 2 GHz 四核Intel Core i5 | 16 GB |
测试所需软件及版本
- Elasticsearch 7.10
- Kibana 7.10
- INFINI Gateway 最新版本
- Logstash 7.10
- Metricbeat 7.10
本文就省略以上软件的下载和安装步骤了。 另外本文中测试 Elasticsearch 集群含两个节点,每个节点配置内存都为 1GB ,其他参数均为默认。
测试步骤
准备测试数据文件
本文测试数据文件 nginx_mock_log ,文件中每行结构如下:
{"timestamp":1611540661651,"method":"POST","msg":"mock log"}
大概一千多万条
Logstatsh 使用 Input file 模式直接输出数据到 Elasticsearch
编辑 Logstash 配置 test.conf 如下:
input{
file {
path => ["/test/nginx_mock_log"]
type => "file_monitor"
start_position => "beginning"
}
}
output{
elasticsearch {
hosts => ["localhost:9200"]
index => "nginx_mock_log"
http_compression => false
}
}
在 kibana 中创建索引 nginx_mock_log ,将主分片设置为2(为了体现出 Gateway的性能优势, 主分片数应设置大于1), 配置如下:
PUT nginx_mock_log
{
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"host" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"path" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"settings" : {
"number_of_shards" : "2"
}
}
运行 Logstash
/usr/local/logstash/bin/logstash -f test.conf
打开 Kibana Stack Monitorning 查看 Indexing Rate 监控指标如下图:
从图中可以看到索引速率基本保持在4300/s 上下
Logstatsh 使用 Input file 模式输出数据到 Gateway
进入 Kibana 删除索引 nginx_mock_log 并重建
DELETE nginx_mock_log
PUT nginx_mock_log
{
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"host" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"message" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"path" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"settings" : {
"number_of_shards" : "2"
}
}
修改 Logstash 配置 test.conf 如下:
input{
file {
path => ["/test/nginx_mock_log"]
type => "file_monitor"
start_position => "beginning"
}
}
output{
elasticsearch {
hosts => ["localhost:8000"]
index => "nginx_mock_log"
http_compression => false
}
}
修改 Gateway 配置文件 gateway.yaml 如下:
path.data: data
path.logs: log
entry:
- name: es_gateway #your gateway endpoint
enabled: true
router: default
network:
binding: localhost:8000
reuse_port: true #you can start multi gateway instance, they share same port, to full utilize system's resources
flow:
- name: bulk_es_test
filter: #comment out any filter sections, like you don't need cache or rate-limiter
- name: bulk_reshuffle
parameters:
elasticsearch: dev
level: node
mode: async
- name: elasticsearch
parameters:
elasticsearch: dev
refresh:
enabled: true
interval: 30s
- name: request_logging
filter:
- name: request_logging
parameters:
queue_name: request_logging
router:
- name: default
default_flow: bulk_es_test
tracing_flow: request_logging
elasticsearch:
- name: dev
enabled: true
endpoint: http://localhost:9200 # if your elasticsearch is using https, your gateway should be listen on as https as well
basic_auth: #used to discovery full cluster nodes, or check elasticsearch's health and versions
username: elastic
password: yV6syH3KLt4DxqMlCyag
discovery: # auto discovery elasticsearch cluster nodes
enabled: true
refresh:
enabled: true
modules:
- name: elastic
enabled: true
elasticsearch: dev
store:
enabled: true
orm:
enabled: true
init_template: true
template_name: ".infini-default1"
index_prefix: "gateway_"
- name: pipeline
enabled: true
runners:
- name: nodes_index
enabled: true
max_go_routine: 2
threshold_in_ms: 0
timeout_in_ms: 5000
pipeline_id: bulk_request_ingest
- name: request_logging_test_name
enabled: true
max_go_routine: 2
threshold_in_ms: 0
timeout_in_ms: 5000
pipeline_id: request_logging_index
pipelines:
- name: bulk_request_ingest
start:
joint: bulk_indexing
enabled: true
parameters:
elasticsearch: "dev"
timeout: "5s"
worker_size: 10
bulk_size_in_mb: 1 #in MB
- name: request_logging_index
start:
joint: json_indexing
enabled: true
parameters:
index_name: "gateway_requests"
elasticsearch: "dev"
input_queue: "request_logging"
timeout: "5s"
worker_size: 10
bulk_size_in_mb: 1 #in MB
queue:
min_msg_size: 1
max_msg_size: 5000000000
max_bytes_per_file: 53687091200
sync_every_records: 100000 # sync by records count
sync_timeout_in_ms: 10000 # sync by time in million seconds
write_chan_buffer: 1000
read_chan_buffer: 1000
以上各配置节点含义,请参考 Gateway 文档
启动 Gateway
./gateway
删除 Logstash data 目录
rm -rf /usr/local/logstash/data
启动 Logstash
/usr/local/logstash/bin/logstash -f test.conf
打开 Kibana Stack Monitorning 查看 Indexing Rate 监控指标如下图:
从上图后半部分可以看到索引速率可以保持在 25000/s 上下(一会儿的功夫,一千多万条数据导入ES完事了)
前面看到 Gateway 配置开启了 request_logging,因此可以在 Kibana Dashboard 里面的 INFINI Gateway Dashboard 查看请求信息,如下图:
注意,上面图中的请求速率是 _bulk 请求的速率,不是索引速率
总结
从测试结果来看,相同环境下,用 Logstash elasticsearch output 输出数据到 Gateway 的方式比 Logstash elasticsearch output 直接到 ES 的方式速率快了4倍,不得不说这速率是真的杠杠的。至于能不能通过参数调优再提升速率呢?大家有兴趣的自己下载测试吧!最后感谢 medcl 大神出品。
收起阅读 »