首页 技术 正文
技术 2022年11月14日
0 收藏 921 点赞 4,445 浏览 1817 个字

环境准备

  linux centOS(工作环境)

  python3.4及以上

  pip3

  JDK8

  git1.9及以上

  gradle2.13及以上

 准备过程中的坑

  这些环境准备没什么太大问题,都是wget下来安装就行,唯一有一个python3安装的坑。

  由于本人安装的是python3.6.1,pip3和setupTools都是集成在python安装包里的,比python2时代方便许多,当一切都井井有条后,pip3 install esrally,报出如下错误

  Could not fetch URL https://pypi.python.org/simple/esrally/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. – skipping

  这是因为pip3默认采用https协议获取资源,而ssl模块有点问题,最后找到的解决方法

  1.治标

  通过在~/.pip/pip.conf文件中加入

  trusted-host = 你要信任的url

  不采用https协议获取资源

  2.治本

  把当前的openssl-devel卸载了,然后重新安装一个

  yum remove openssl-devel

  yum install openssl-devel

  在python3.6中的/Modules/Setup 修改了启动配置

#修改结果如下:
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto

  然后重新编译

esrally使用

通过esrally configure配置,根据提示来就行,如下图所示

elasticsearch系列(二) esrally压测

使用本地es集群测试

–pipeline=benchmark-only

es官网下载

–pipeline=from-distribution

测试数据集,默认是geonames

–track=geonames

使用离线的数据集

–offline

常用命令组合

//第一次压测需要从远端下载数据集

esrally –pipeline=benchmark-only –target-hosts=host:9200 –distribution-version=5.2.2(本人用的5.2.2)

//之后数据集不变的话,直接使用本地数据集

esrally –pipeline=benchmark-only –target-hosts=host:9200 –distribution-version=5.2.2 –offline

注意

es集群必须处理green状态,否则会被禁止race

默认的压测数据的压测配置在 /root/.rally/benchmarks/tracks/default/geonames/track.json

默认压测的内容比较多,可以自定义压测内容,比如数据导入,数据搜索,统计搜索等,都是些es支持的命令

也有类似jmeter的压测配置,比如并发量,迭代次数,额定吞吐量,调度时间等

下图是esrally的压测的部分结果

elasticsearch系列(二) esrally压测

总结

esrally是官方做压测的开源工具,权威程度不言而喻,但是有点复杂,相当于又学了一个部署复杂版的jmeter。所以如果单单只是想测试ES搜索性能的话,建议使用jmeter。

参考资料

//官网的rally教程

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

//官网的rally教程,关于压测内容的详细说明

http://esrally.readthedocs.io/en/0.5.3/track.html#search

//网友对rally的总结

http://m.blog.csdn.net/article/details?id=56291834

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,493
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,133
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,297