ESRally基准测试工具离线使用简介

ESRally安装

运行ESRally需要依赖Python3,Git。本篇是针对Centos7系统。

安装依赖

安装Python3

yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
解压Python-3.5.0.tgz安装包
sudo mkdir /usr/local/python3
sudo Python-3.5.0/configure --prefix=/usr/local/python3
sudo make
sudo make install

Centos7自带了Python2.7,需要升级到Python3

1 备份原版python2.7
sudo mv /usr/bin/python /usr/bin/python.bak
2 创建连接
sudo ln -s /usr/local/python3/bin/python3  /usr/bin/python
3 创建pip连接
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
4 修改yum
sudo vi /usr/bin/yum
python -> python2

安装Git

ESRally要求git的版本>=1.9

1.依赖
 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
 yum install gcc perl-ExtUtils-MakeMaker
2.解压
3.安装
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile
git --version

安装ESRally

使用esrally-dist-1.3.0.tar.gz安装包

tar -xzf esrally-dist-1.3.0.tar.gz
sudo ./esrally-dist-1.3.0/install.sh
ln -s /usr/local/python3/bin/esrally /usr/bin/esrally

数据准备

Esrally提供了自动下载数据集的脚本

curl -O https://raw.githubusercontent.com/elastic/rally-tracks/master/download.sh

chmod u+x download.sh

下载geonames数据集

./download.sh geonames

拷贝到目标机器后,解压在当前用户的根目录

tar -xvf rally-track-data-geonames.tar -C ~/

ESRally测评

运行一次基准测试

运行一次基准测试称为一次race

esrally race --pipeline=benchmark-only --target-hosts=10.202.77.206:9200 --offline --track=geonames  --challenge=append-no-conflicts

参数说明:

--pipeline

from-sources-complete    编译并运行ES,执行benchmarks并生成报告

from-sources-skip-build   跳过编译运行ES,执行benchmarks并生成报告

from-distribution        下载ES发行版,执行benchmarks并生成报告

benchmark-only        在已经运行的ES实例上,执行benchmarks并生成报告

--target-hosts  指定ES地址

--offline 离线模式

--report-format {markdown,csv}

Define the output format for the command line report (default: markdown).

--report-file REPORT_FILE

--report-file REPORT_FILE

Write the command line report also to the provided file.

查看运行记录

esrally list races

对比基准测试运行结果

比较不同 race 的结果称为一次tournament

esrally  compare --baseline= bc39a7d2-90b8-4b44-9498-9ec3dac49d80 --contender= ac490a91-68cc-4c48-9bfe-78005c2debc7

连接

https://esrally.readthedocs.io/en/stable/

 

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值