2. Elasticsearch 7.2.0 esrally 压力测试安装与测试学习

所用操作系统ubuntu 18.04 , Elasticsearch 7.2.0  本地三节点集群(因为是虚拟机所以只启动了两个节点)

所需环境:

1. python3 安装(ubuntu 自带)

2. jdk-12  安装 

openjdk 11 和8 都安装过,但运行测试时提示要jdk12 重新去 oracle 官网下载的,下载完成后设置环境变量

sudo vim /etc/profile   并添加以下内容(注意改成你自己的目录)            

export JAVA_HOME=/home/muwei/software/jdk-12.0.1
export PATH=.:$JAVA_HOME/bin:$PATH

  source /etc/profile  使配置生效

           

3. git 安装

sudo apt install git       成功如图所示

4. pip3 安装

sudo apt install python3-pip 安装过程中可能出现网络连接慢或断网的情况,请重新执行,我安装了3次才成功

5. esrally 安装

pip3 install esrally 安装过程中可能出现网络连接慢或断网的情况,请重新执行,我安装了2次才成功

6. esrally 配置

esrally configure --advanced-config  一路回车下来先,一会再改配置文件

7. 下载 esrally的测试数据(可以使作本地数据测试,请参照官方文档)

esrally运行时可以自己去下载测试文档,但是太慢了,慢到你怀疑人生(可能是我网络的原因吧,500M的宽带,2小时没动静),为了方便我已将相应数据放入百度网盘中了(永久有效),https://pan.baidu.com/s/19IJ75mBXZwimEbDcdqjnuQ    提取码:qhaj 
8. 真正的esrally配置 修改 用户目录下

A  .rally/rally.ini (将root.dir  src.root.dir    local.dataset.cache  default.url(两个)设置成自己对应的目录)

[meta]
config.version = 17

[system]
env.name = local

[node]
root.dir = /home/muwei/.rally/benchmarks
src.root.dir = /home/muwei/.rally/benchmarks/src

[source]
remote.repo.url = https://github.com/elastic/elasticsearch.git
elasticsearch.src.subdir = elasticsearch

[benchmarks]
local.dataset.cache = /home/muwei/.rally/benchmarks/data

[reporting]
datastore.type = in-memory
datastore.host = 
datastore.port = 
datastore.secure = False
datastore.user = 
datastore.password = 

[tracks]
default.url = /home/muwei/.rally/benchmarks/tracks/default

[teams]
default.url = /home/muwei/.rally/benchmarks/teams/default

[defaults]
preserve_benchmark_candidate = False

[distributions]
release.cache = true

B.  将下载下来的数据包.bz2 放入相应目录

C.  修改.rally/benchmarks/tracks/default/geonames/track.json  中的 data-url 和 base-url 改成刚才放文件的目录(可以不改的)

{% import "rally.helpers" as rally with context %}
{
  "version": 2,
  "description": "POIs from Geonames",
  "data-url": "/home/username/.rally/benchmarks/data/documents-2.json.bz2",
  "indices": [
    {
      "name": "geonames",
      "body": "index.json"
    }
  ],
  "corpora": [
    {
      "name": "geonames",
      "base-url": "/home/username/.rally/benchmarks/data/documents-2.json.bz2",
      "documents": [
        {
          "source-file": "documents-2.json.bz2",
          "document-count": 11396505,
          "compressed-bytes": 264698741,
          "uncompressed-bytes": 3547614383
        }
      ]
    }
  ],
  "operations": [
    {{ rally.collect(parts="operations/*.json") }}
  ],
  "challenges": [
    {{ rally.collect(parts="challenges/*.json") }}
  ]
}

9. 运行测试  esrally race --pipeline=benchmark-only --target-hosts=127.0.0.1:9200 --offline --track=geonames --challenge=append-no-conflicts-index-only

结果如下:


    ____        ____
   / __ \____ _/ / /_  __
  / /_/ / __ `/ / / / / /
 / _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
                /____/


************************************************************************
************** WARNING: A dark dungeon lies ahead of you  **************
************************************************************************

Rally does not have control over the configuration of the benchmarked
Elasticsearch cluster.

Be aware that results may be misleading due to problems with the setup.
Rally is also not able to gather lots of metrics at all (like CPU usage
of the benchmarked cluster) or may even produce misleading metrics (like
the index size).

************************************************************************
****** Use this pipeline only if you are aware of the tradeoffs.  ******
*************************** Watch your step! ***************************
************************************************************************

[INFO] Racing on track [geonames], challenge [append-no-conflicts-index-only] and car ['external'] with version [7.2.0].

[INFO] Decompressing track data from [/home/muwei/.rally/benchmarks/data/geonames/documents-2.json.bz2] to [/home/muwei/.rally/benchmarks/data/geonames/documents-2.json] (resulting size: 3.30 GB) ... [OK]
[INFO] Preparing file offset table for [/home/muwei/.rally/benchmarks/data/geonames/documents-2.json] ... [OK]
Running delete-index                                                           [100% done]
Running create-index                                                           [100% done]
Running check-cluster-health                                                   [100% done]
Running index-append                                                           [100% done]
Running force-merge                                                            [100% done]

------------------------------------------------------
    _______             __   _____
   / ____(_)___  ____ _/ /  / ___/_________  ________
  / /_  / / __ \/ __ `/ /   \__ \/ ___/ __ \/ ___/ _ \
 / __/ / / / / / /_/ / /   ___/ / /__/ /_/ / /  /  __/
/_/   /_/_/ /_/\__,_/_/   /____/\___/\____/_/   \___/
------------------------------------------------------
            
|   Lap |                                                         Metric |         Task |     Value |   Unit |
|------:|---------------------------------------------------------------:|-------------:|----------:|-------:|
|   All |                     Cumulative indexing time of primary shards |              |   113.172 |    min |
|   All |             Min cumulative indexing time across primary shards |              |   22.0114 |    min |
|   All |          Median cumulative indexing time across primary shards |              |   22.6385 |    min |
|   All |             Max cumulative indexing time across primary shards |              |   23.3463 |    min |
|   All |            Cumulative indexing throttle time of primary shards |              |         0 |    min |
|   All |    Min cumulative indexing throttle time across primary shards |              |         0 |    min |
|   All | Median cumulative indexing throttle time across primary shards |              |         0 |    min |
|   All |    Max cumulative indexing throttle time across primary shards |              |         0 |    min |
|   All |                        Cumulative merge time of primary shards |              |   20.6712 |    min |
|   All |                       Cumulative merge count of primary shards |              |        74 |        |
|   All |                Min cumulative merge time across primary shards |              |   3.80508 |    min |
|   All |             Median cumulative merge time across primary shards |              |   4.09335 |    min |
|   All |                Max cumulative merge time across primary shards |              |   4.48805 |    min |
|   All |               Cumulative merge throttle time of primary shards |              |   1.56222 |    min |
|   All |       Min cumulative merge throttle time across primary shards |              |     0.245 |    min |
|   All |    Median cumulative merge throttle time across primary shards |              |  0.301917 |    min |
|   All |       Max cumulative merge throttle time across primary shards |              |  0.372517 |    min |
|   All |                      Cumulative refresh time of primary shards |              |    8.3603 |    min |
|   All |                     Cumulative refresh count of primary shards |              |       189 |        |
|   All |              Min cumulative refresh time across primary shards |              |   1.55828 |    min |
|   All |           Median cumulative refresh time across primary shards |              |   1.65632 |    min |
|   All |              Max cumulative refresh time across primary shards |              |   1.78607 |    min |
|   All |                        Cumulative flush time of primary shards |              |   0.39115 |    min |
|   All |                       Cumulative flush count of primary shards |              |         5 |        |
|   All |                Min cumulative flush time across primary shards |              | 0.0649833 |    min |
|   All |             Median cumulative flush time across primary shards |              |    0.0753 |    min |
|   All |                Max cumulative flush time across primary shards |              |   0.09795 |    min |
|   All |                                             Total Young Gen GC |              |    77.126 |      s |
|   All |                                               Total Old Gen GC |              |    11.181 |      s |
|   All |                                                     Store size |              |     4.635 |     GB |
|   All |                                                  Translog size |              |   2.79172 |     GB |
|   All |                                         Heap used for segments |              |     19.57 |     MB |
|   All |                                       Heap used for doc values |              |  0.133533 |     MB |
|   All |                                            Heap used for terms |              |   18.1498 |     MB |
|   All |                                            Heap used for norms |              |  0.172119 |     MB |
|   All |                                           Heap used for points |              |  0.284651 |     MB |
|   All |                                    Heap used for stored fields |              |  0.829834 |     MB |
|   All |                                                  Segment count |              |       221 |        |
|   All |                                                 Min Throughput | index-append |   11596.8 | docs/s |
|   All |                                              Median Throughput | index-append |   17170.6 | docs/s |
|   All |                                                 Max Throughput | index-append |     19319 | docs/s |
|   All |                                        50th percentile latency | index-append |   1512.85 |     ms |
|   All |                                        90th percentile latency | index-append |   3110.63 |     ms |
|   All |                                        99th percentile latency | index-append |   4777.27 |     ms |
|   All |                                      99.9th percentile latency | index-append |   6465.09 |     ms |
|   All |                                       100th percentile latency | index-append |   8449.45 |     ms |
|   All |                                   50th percentile service time | index-append |   1512.85 |     ms |
|   All |                                   90th percentile service time | index-append |   3110.63 |     ms |
|   All |                                   99th percentile service time | index-append |   4777.27 |     ms |
|   All |                                 99.9th percentile service time | index-append |   6465.09 |     ms |
|   All |                                  100th percentile service time | index-append |   8449.45 |     ms |
|   All |                                                     error rate | index-append |         0 |      % |


---------------------------------
[INFO] SUCCESS (took 728 seconds)
---------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值