首页 > 学院 > 操作系统 > 正文

elasticsearch 5.2 部署及Rally压力测试

2024-06-28 16:02:01
字体:
来源:转载
供稿:网友

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.0.zip

unzip elasticsearch-5.2.0.zipchown -R es.es elasticsearch-5.2.0es启动需要在非root下,新建账号和创建数据目录useradd esmkdir /export/es52/修改配置文件cat elasticsearch.ymlpath.data: /export/es52/datapath.logs: /export/es52/logsnetwork.host: 192.168.80.11启动./bin/elasticsearch -djps 验证curl http://192.168.80.11:9200/{  "name" : "g-H2EPn",  "cluster_name" : "elasticsearch",  "cluster_uuid" : "UbMTV1G5QtGyBjCRZ9XJSw",  "version" : {    "number" : "5.2.0",    "build_hash" : "24e05b9",    "build_date" : "2017-01-24T19:52:35.800Z",    "build_snapshot" : false,    "lucene_version" : "6.4.0"  },  "tagline" : "You Know, for Search"}配合kibana安装x-pack监控插件./elasticsearch-plugin  install x-pack添加配置项#x-packaction.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*重启es安装kibanahttps://artifacts.elastic.co/downloads/kibana/kibana-5.2.0-linux-x86_64.tar.gztar zxvf kibana-5.2.0-linux-x86_64.tar.gz./kibana-plugin install x-pack修改配置cat kibana.ymlserver.host: "192.168.80.11"elasticsearch.url: "http://192.168.80.11:9200"启动nohup ./kibana &http://192.168.80.11:5601默认账号: elastic 和 changeme 其实我们能用到的功能也就Dev tools和Monitoring压测ES---Rally安装使用github上提供了rally作为elasticsearch的性能测试工具,较好的解决了es性能测试问题。依赖环境:python3.4+pip3JDK8git1.9+Gradle2.13+(可选如果需要从源代码编译则需要)python3 与 pip3 安装与使用yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-develtar zxvf Python-3.5.2.tgzcd Python-3.5.2./configure --PRefix=/usr/local/python3make && make install mv /usr/bin/python  /usr/bin/python_oldln -s /usr/local/python3/bin/python3.5  /usr/bin/pythonpython --versionln -s /usr/python3.5/bin/pip3.5  /usr/bin/pip 安装完成默认就有pip3了yum install gcc perl-ExtUtils-MakeMaker curl-devel expat-devel gettext-devel openssl-devel zlib-develyum remove gittar xzf git-2.11.0.tar.gzcd git-2.11.0make prefix=/usr/local/git allmake prefix=/usr/local/git installecho "export PATH=$PATH:/usr/local/git/bin" >> /etc/profilesource /etc/profilegit --versionjdk安装解压即可java -versionjava version "1.8.0_112"安装gradleGradle 是一款构建工具,继 Ant 、Maven 之后的现代构建工具。http://services.gradle.org/distributions/gradle-2.13-all.zipmkdir /opt/gradleunzip -d /opt/gradle gradle-2.13-all.zipcat /etc/profileexport PATH=$PATH:/opt/gradle/gradle-2.13/binsource /etc/profilegradle -v安装esrally (其实绝对路径即可)pip3 install esrally 由于elasticsearch的运行必须非root账户。esrally建议用非root账户执行。“race”表示Rally一次压测过程。你可以使用不同的数据集(称之为tracks)来进行压测。非root用户(es用户)初始化./esrally configureEnter the JDK 8 root directory:: /export/servers/jdk1.8.0_112下载数据集

./esrally list tracks

这时可以查看配置文件/root/.rally/rally.ini[reporting]datastore.type = in-memorydatastore.host = 192.168.80.11datastore.port = 9200datastore.secure = Falsedatastore.user =datastore.passWord =提前准备数据:在.rally/benchmarks下(没有的目录自己创建即可)data  distributions  races  tracks把源码包下载下来distributions/elasticsearch-5.2.0.tar.gz.rally/benchmarks/data/geonamesdocuments.json.bz2放入该目录下。http://benchmarks.elasticsearch.org.s3.amazonaws.com/corpora/geonames/documents.json.bz2(下载过程漫长)

./esrally --distribution-version=5.2.0

./esrally --target-hosts=192.168.80.11:9200 --challenge=append-fast-no-conflicts --pipeline=benchmark-only

参考文档:https://github.com/elastic/rally

【原创】原创文章,更多关注敬请关注微信公众号。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表