Elasticsearch压测
1. 安装这篇文章详细描述了安装Rally。
1.1. 前置条件
在安装Rally之前请确保以下包已经安装成功
[*] Python3.4+ (验证python3 --version应该打印 Python 3.4.0或以上)
http://s2.运维网.com/wyfs02/M02/8B/ED/wKiom1hcjSzzbjnTAAAJkGBUtfk493.png
pip3(验证pip3 --version)
http://s5.运维网.com/wyfs02/M00/8B/EE/wKiom1hctcmRmmH4AAAQN0qd42Y768.png
[*] JDK8
[*] git1.9+
[*] Gradle2.13+(可选如果需要从源代码编译则需要)
[*] 非root用户(由于ES2.0需要非root运行Rally也必须以非root运行)
1.2. 安装Rally
sudo pip3 install esrally
2. 配置
安装完成后需要配置Rally。首次运行esrally将会检测配置文件是否丢失然后询问你一些问题
./esrally
http://s1.运维网.com/wyfs02/M02/8B/EB/wKioL1hcu2_iHGCUAACKpgb1zX8159.png-wh_500x0-wm_3-wmp_4-s_1122240139.png3. 运行Races
“race”表示Rally一次压测过程。你可以使用不同的数据集(称之为tracks)来进行压测。
3.1. Tracks列表
./esrally list tracks
http://s2.运维网.com/wyfs02/M00/8B/EF/wKiom1hcu6aCMwxaAACD95Lvtog377.png3.2. 运行race
默认执行geonames track需要下载可以自行下载数据集
http://benchmarks.elasticsearch.org.s3.amazonaws.com/corpora/geonames/documents.json.bz2
将下载文件放入/home/User/.rally/benchmarks/data/geonames中
3.2.1. 默认压测
./esrally --distribution-version=2.2.1
此次将会下载elasticsearch-2.2.1.tar.gz包并将此包放入/home/User/.rally/benchmarks/distributions你也可以自己下载放入此中
http://s1.运维网.com/wyfs02/M02/8B/EB/wKioL1hcu_LgdDExAACeXg6d1cU228.png-wh_500x0-wm_3-wmp_4-s_1620409673.png
3.2.2. 压测插入
./esrally --distribution-version=2.2.1
--challenge=append-fast-no-conflicts --pipeline=benchmark-only
http://s3.运维网.com/wyfs02/M01/8B/EF/wKiom1hcvB6Bn-8JAACeBLgv8DE783.png-wh_500x0-wm_3-wmp_4-s_1554238308.png3.2.3. 压测更新
./esrally --distribution-version=2.2.1
--challenge=append-fast-with-conflicts --pipeline=benchmark-only
http://s5.运维网.com/wyfs02/M00/8B/EB/wKioL1hcvFCD1gTBAACsTVw-GJQ718.png-wh_500x0-wm_3-wmp_4-s_410616226.png3.2.4. 压测已存在的es环境
当已经存在Elasticsearch部署环境则可以使用--target-hosts来指定
./esrally --target-hosts=172.16.54.135:9200
--challenge=append-fast-no-conflicts --pipeline=benchmark-only
http://s3.运维网.com/wyfs02/M01/8B/EB/wKioL1hcvInDmCtNAAAqK7ZfE0A798.pnghttp://s2.运维网.com/wyfs02/M02/8B/EF/wKiom1hcvJjASeBjAACg4kNE1LU514.png-wh_500x0-wm_3-wmp_4-s_1080416250.png
页:
[1]