返回介绍

PART Ⅰ : 容器云OPENSHIFT

PART Ⅱ:容器云 KUBERNETES

PART Ⅲ:持续集成与持续部署

PART Ⅴ:日志/监控/告警

PART Ⅵ:基础

PART Ⅶ:数据存储、处理

PART VIII:CODE

PART X:HACKINTOSH

PART XI:安全

elasticsearch性能测试

发布于 2024-06-08 21:16:46 字数 7970 浏览 0 评论 0 收藏 0

ElasticSearch性能测试esrally

官方文档:https://esrally.readthedocs.io/en/stable/

GitHub:https://github.com/elastic/rally

1、安装esrally

pip3 install esrally

brew install pbzip2

2、配置

1、命令格式

esrally [-h] [--version] {race,list,info,create-track,generate,compare,download,install,start,stop} 

可选参数:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

子命令:
  {race,list,info,create-track,generate,compare,download,install,start,stop}
    race                Run a benchmark
    list                List configuration options
    info                Show info about a track
    create-track        Create a Rally track from existing data
    generate            Generate artifacts
    compare             Compare two races
    download            Downloads an artifact
    install             Installs an Elasticsearch node locally
    start               Starts an Elasticsearch node locally
    stop                Stops an Elasticsearch node locally

Find out more about Rally at https://esrally.readthedocs.io/en/2.2.0/

2、子命令

①列出内置的测试数据

$ esrally list tracks
测试数据测试数据描述文档个数压缩后大小未压缩大小Default ChallengeAll Challenges
geonamesPOIs from Geonames11,396,503252.9 MB3.3 GBappend-no-conflictsappend-no-conflicts,append-no-conflicts-index-only,append-sorted-no-conflicts,append-fast-with-conflicts,significant-text
percolatorPercolator benchmark based on AOL queries2,000,000121.1 kB104.9 MBappend-no-conflictsappend-no-conflicts
http_logsHTTP server log data247,249,0961.2 GB31.1 GBappend-no-conflictsappend-no-conflicts,runtime-fields,append-no-conflicts-index-only,append-sorted-no-conflicts,append-index-only-with-ingest-pipeline,update,append-no-conflicts-index-reindex-only
geoshapeShapes from PlanetOSM60,523,28313.4 GB45.4 GBappend-no-conflictsappend-no-conflicts
metricbeatMetricbeat data1,079,60087.7 MB1.2 GBappend-no-conflictsappend-no-conflicts
geopointPoint coordinates from PlanetOSM60,844,404482.1 MB2.3 GBappend-no-conflictsappend-no-conflicts,append-no-conflicts-index-only,append-fast-with-conflicts
nyc_taxisTaxi rides in New York in 2015165,346,6924.5 GB74.3 GBappend-no-conflictsappend-no-conflicts,append-no-conflicts-index-only,append-sorted-no-conflicts-index-only,update,append-ml,date-histogram
geopointshapePoint coordinates from PlanetOSM indexed as geoshapes60,844,404470.8 MB2.6 GBappend-no-conflictsappend-no-conflicts,append-no-conflicts-index-only,append-fast-with-conflicts
soIndexing benchmark using up to questions and answers from StackOverflow36,062,2788.9 GB33.1 GBappend-no-conflictsappend-no-conflicts
eventdataThis benchmark indexes HTTP access logs generated based sample logs from the elastic.co website using the generator available in https://github.com/elastic/rally-eventdata-track20,000,000756.0 MB15.3 GBappend-no-conflictsappend-no-conflicts,transform
eqlEQL benchmarks based on endgame index of SIEM demo cluster60,782,2114.5 GB109.2 GBdefaultdefault
nestedStackOverflow Q&A stored as nested docs11,203,029663.3 MB3.4 GBnested-search-challengenested-search-challenge,index-only
noaaGlobal daily weather measurements from NOAA33,659,481949.4 MB9.0 GBappend-no-conflictsappend-no-conflicts,append-no-conflicts-index-only,top_metrics,aggs
pmcFull text benchmark with academic papers from PMC574,1995.5 GB21.7 GBappend-no-conflictsappend-no-conflicts,append-no-conflicts-index-only,append-sorted-no-conflicts,append-fast-with-conflicts

②创建测试实例

esrally create-track \
    --track=http_logs \
    --target-hosts=127.0.0.1:9200 \
    --client-options="timeout:60,basic_auth_user:'elastic',basic_auth_password:'*****'" \
    --indices="products,companies" \
    --output-path=~/tracks
  • track.json contains the actual Rally track. For details see the track reference.
  • companies.json and products.json contain the mapping and settings for the extracted indices.
  • *-documents.json(.bz2) contains the sources of all the documents from the extracted indices. The files suffixed with -1k contain a smaller version of the document corpus to support test mode.

1、安装esrally

pip3 install esrally

2、创建测试任务和数据

esrally create-track \
    --track=http_logs \
    --target-hosts=127.0.0.1:9200 \
    --client-options="timeout:60,basic_auth_user:'elastic',basic_auth_password:'*****" \
    --indices="products,companies" \
    --output-path=~/tracks
  • 3、

esrally race --distribution-version=6.0.0 --track=geopoint --challenge=append-fast-with-conflicts
esrally list tracks
esrally list races

esrally create-track \
    --track=http_logs \
    --target-hosts=127.0.0.1:9200 \
    --client-options="timeout:60,basic_auth_user:'elastic',basic_auth_password:'*****'" \
    --indices="products,companies" \
    --output-path=~/tracks

esrally race \
--target-hosts=127.0.0.1:9200 \
--client-options="timeout:60,basic_auth_user:'elastic',basic_auth_password:'*****'" \
--track=geonames

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文