• esRally国内安装使用避坑指南-全网最新


      按照官网的步骤来,一步一个坑,浪费了我一天的时间!多数是因为国内的网络,下载和拉取速度太慢,导致安装失败。所以写了这个文章,来记录我成功安装的案例,希望可以帮到想用esrallu做基准测试的人!

      网上也有文章不过都过时了!官网呢,又不适合中国网络情况的使用。我甚至严重怀疑,官网的步骤,他们有没有执行一遍试试。因为用哪些命令肯定会遇到问题。比如:

    sudo yum install git

      我不相信这条命令,能帮我们下载新版本的git!

      注意目前esrally最新版本是 2.5.0!

      官网地址(英文的最新版):Quickstart — Rally 2.5.0 documentation

      中文文档(0.9版本的):安装 — Rally 0.9.0 文档

    准备环境-需要的环境介绍

      我在看文档的时候,其实蛮想知道我为什么要安装这些东西,以及不安装行不行,我需要安装什么版本的。我在看着官网折腾这个的时候浪费了挺多时间,所以特地写一篇博客来带大家避坑!

      操作系统 centos7,我是在centos7下安装的,其它版本,操作系统不适用,其它版本我没有验证能否成功。esrally只能运行在linux下!

      安装过程需要网络环境。即使有网络,在装一些东西的时候依旧有很多问题,所以我在安装一些东西的时候,也会用安装包安装,来减少问题的出现。

      另外说一句,esrally文档是写给外国人的,因为一些网络环境我们不具备,所以根据文档操作,一大堆问题。

    想要运行esrally必备的工具

    1. python3.8以上版本,我看官网的例子是用python3.8.10的版本。为了减少问题,我也用python3.8.10。说一下为什么要用它,因为esrally是用python写的,安装也用到了pip3。这些都属于必备的!
    2. git,版本1.9及以上版本。用git是因为es用到的数据都放在了网上,用到的测试用例也放在git上,所以需要我们在用的时候拉取。这个也是必须的,没有不行!
    3. JDK。用这个是因为,esrally支持自动构建es集群,就是帮你搭建集群。es低版本(7版本之前)并没有内嵌JDK,所以这些版本需要JDK,并配置好环境。如果你是自建集群,对已有的集群进行测试,那就不需要JDK了。如果需要它帮你搭建集群,你就需要将JDK环境配置好。
    4. esrally,es基准测试的主角。

    如何在linux centos下安装python环境

      这篇文章是我在用esrally的时候写的,我跟着官网做的时候遇到很多坑,主要是浪费了时间,实在没必要。我的这个方案更简单!请看我这篇文章:

    centos下编译安装各个版本的python_水的精神的博客-CSDN博客

    如何升级git,或者说安装git

      centos7默认安装了git,遗憾的是它的版本是1.8的。也就是低于官网要求的1.9版本。所以需要升级。在网上找文档折腾的半天,都不靠谱。所以建议看我这篇文章(特简单,三条命令):

    Linux centos下三条命令安装升级git_水的精神的博客-CSDN博客

    如何安装JDK

    下载安装jdk13

    https://www.oracle.com/java/technologies/javase-jdk13-downloads.html

    复制

    下载,上传到服务器上。

    然后rpm安装

    rpm -ivh jdk-13.0.2_linux-x64_bin.rpm

    配置环境变量,在 /etc/profile文件的末尾加入以下内容

    1. export JAVA_HOME=/usr/java/jdk-13.0.2
    2. export PATH=$JAVA_HOME/bin:$PATH
    3. export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    并执行下列命令使环境变量生效

    source /etc/profile

    安装esrally

      官网给的操作是使用一条命令安装,开起来很简单:

    pip3 install esrally

      但是我执行不成功。可能我对python不是很熟悉的原因把。我用的其它方式来安装的(离线安装 esrally 是最靠谱的,解决拉取问题!我在尝试上边的命令的时候,遇到了一堆问题。不想解决了!所以用离线的方式来安装它):

    1. 安装上面文档提到的所有依赖包
    2. 下载 最新发布的离线包 ,并将它拷贝到目标机器。
    3. 解压安装包 tar -xzf esrally-dist-*.tar.gz 。
    4. 执行安装脚本 sudo ./esrally-dist-*/install.sh 。

      在执行第四条的时候,还是遇到了问题(我把遇到几个问题贴出来,希望可以帮到你们):

    执行 ./install.sh 第一个问题:

    ERROR: Could not find a version that satisfies the requirement py-cpuinfo==7.0.0 (from esrally) (from versions: 7.0.0)
    ERROR: No matching distribution found for py-cpuinfo==7.0.0

    解决命令:

    pip3 install py-cpuinfo -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn 

    执行 ./install.sh 第二个问题(python pip相关的问题):

    问题

    WARNING: You are using pip version 21.1.1; however, version 22.1.2 is available.
    You should consider upgrading via the '/usr/local/python38/bin/python3.8 -m pip install --upgrade pip' command.

    解决命令:

    python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn

    第三个问题:

    解决问题:

    pip3 install --upgrade setuptools  -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn

    以上三个问题解决完以后,esrally已经可以成功安装了!

    尝试运行一下,因为我已经安装过了es集群。所以已经可以使用了!

    命令如下:

    esrally race --track=percolator --target-hosts=10.10.10.10:9200,10.10.10.10:9201,10.10.10.10:9202 --pipeline=benchmark-only         

    如果你没有建好的集群,尝试使用这个命令来运行(这个会帮你创建一个es集群,耐心等待,时间比较长):

    esrally --distribution-version=6.0.0

     

    我的案例运行结果如下 :

    1. [root@estest esrally-track]# esrally race --track=percolator --target-hosts=10.10.10.10:9200,10.10.10.10:9201,10.10.10.10:9202 --pipeline=benchmark-only
    2. ____ ____
    3. / __ \____ _/ / /_ __
    4. / /_/ / __ `/ / / / / /
    5. / _, _/ /_/ / / / /_/ /
    6. /_/ |_|\__,_/_/_/\__, /
    7. /____/
    8. [INFO] Race id is [7f280f60-6b48-41db-9ab3-f6977170c417]
    9. [WARNING] Could not update tracks. Continuing with your locally available state.
    10. [WARNING] Could not update tracks. Continuing with your locally available state.
    11. [INFO] Downloading track data (121.1 kB total size) [100.0%]
    12. [INFO] Decompressing track data from [/root/.rally/benchmarks/data/percolator/queries-2.json.bz2] to [/root/.rally/benchmarks/data/percolator/queries-2.json] (resulting size: [0.1... [OK]
    13. [INFO] Preparing file offset table for [/root/.rally/benchmarks/data/percolator/queries-2.json] ... [OK]
    14. [INFO] Racing on track [percolator], challenge [append-no-conflicts] and car ['external'] with version [6.8.0].
    15. [WARNING] merges_total_time is 8107257 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
    16. [WARNING] merges_total_throttled_time is 1274256 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
    17. [WARNING] indexing_total_time is 79966971 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
    18. [WARNING] refresh_total_time is 3806308 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
    19. [WARNING] flush_total_time is 522750 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
    20. Running delete-index [100% done]
    21. Running create-index [100% done]
    22. Running check-cluster-health [100% done]
    23. Running index [100% done]
    24. Running refresh-after-index [100% done]
    25. Running force-merge [100% done]
    26. Running refresh-after-force-merge [100% done]
    27. Running wait-until-merges-finish [100% done]
    28. Running percolator_with_content_president_bush [100% done]
    29. Running percolator_with_content_saddam_hussein [100% done]
    30. Running percolator_with_content_hurricane_katrina [100% done]
    31. Running percolator_with_content_google [100% done]
    32. Running percolator_no_score_with_content_google [100% done]
    33. Running percolator_with_highlighting [100% done]
    34. Running percolator_with_content_ignore_me [100% done]
    35. Running percolator_no_score_with_content_ignore_me [100% done]
    36. ------------------------------------------------------
    37. _______ __ _____
    38. / ____(_)___ ____ _/ / / ___/_________ ________
    39. / /_ / / __ \/ __ `/ / \__ \/ ___/ __ \/ ___/ _ \
    40. / __/ / / / / / /_/ / / ___/ / /__/ /_/ / / / __/
    41. /_/ /_/_/ /_/\__,_/_/ /____/\___/\____/_/ \___/
    42. ------------------------------------------------------
    43. | Metric | Task | Value | Unit |
    44. |---------------------------------------------------------------:|-------------------------------------------:|--------------:|-------:|
    45. | Cumulative indexing time of primary shards | | 1334.87 | min |
    46. | Min cumulative indexing time across primary shards | | 0.39835 | min |
    47. | Median cumulative indexing time across primary shards | | 15.4366 | min |
    48. | Max cumulative indexing time across primary shards | | 26.0545 | min |
    49. | Cumulative indexing throttle time of primary shards | | 0 | min |
    50. | Min cumulative indexing throttle time across primary shards | | 0 | min |
    51. | Median cumulative indexing throttle time across primary shards | | 0 | min |
    52. | Max cumulative indexing throttle time across primary shards | | 0 | min |
    53. | Cumulative merge time of primary shards | | 135.302 | min |
    54. | Cumulative merge count of primary shards | | 805 | |
    55. | Min cumulative merge time across primary shards | | 0.03545 | min |
    56. | Median cumulative merge time across primary shards | | 1.25905 | min |
    57. | Max cumulative merge time across primary shards | | 8.2117 | min |
    58. | Cumulative merge throttle time of primary shards | | 21.2376 | min |
    59. | Min cumulative merge throttle time across primary shards | | 0 | min |
    60. | Median cumulative merge throttle time across primary shards | | 0 | min |
    61. | Max cumulative merge throttle time across primary shards | | 3.46082 | min |
    62. | Cumulative refresh time of primary shards | | 63.4783 | min |
    63. | Cumulative refresh count of primary shards | | 4067 | |
    64. | Min cumulative refresh time across primary shards | | 0.00725 | min |
    65. | Median cumulative refresh time across primary shards | | 0.758333 | min |
    66. | Max cumulative refresh time across primary shards | | 1.46298 | min |
    67. | Cumulative flush time of primary shards | | 8.7125 | min |
    68. | Cumulative flush count of primary shards | | 233 | |
    69. | Min cumulative flush time across primary shards | | 0 | min |
    70. | Median cumulative flush time across primary shards | | 0.0939167 | min |
    71. | Max cumulative flush time across primary shards | | 0.46015 | min |
    72. | Total Young Gen GC time | | 11.337 | s |
    73. | Total Young Gen GC count | | 777 | |
    74. | Total Old Gen GC time | | 0 | s |
    75. | Total Old Gen GC count | | 0 | |
    76. | Store size | | 84.4625 | GB |
    77. | Translog size | | 2.95658 | GB |
    78. | Heap used for segments | | 172.674 | MB |
    79. | Heap used for doc values | | 0.014431 | MB |
    80. | Heap used for terms | | 141.275 | MB |
    81. | Heap used for norms | | 0.038147 | MB |
    82. | Heap used for points | | 7.70514 | MB |
    83. | Heap used for stored fields | | 23.6414 | MB |
    84. | Segment count | | 85 | |
    85. | Total Ingest Pipeline count | | 0 | |
    86. | Total Ingest Pipeline time | | 0 | s |
    87. | Total Ingest Pipeline failed | | 0 | |
    88. | error rate | index | 0 | % |
    89. | Min Throughput | percolator_with_content_president_bush | 47.9 | ops/s |
    90. | Mean Throughput | percolator_with_content_president_bush | 48.16 | ops/s |
    91. | Median Throughput | percolator_with_content_president_bush | 48.16 | ops/s |
    92. | Max Throughput | percolator_with_content_president_bush | 48.43 | ops/s |
    93. | 50th percentile latency | percolator_with_content_president_bush | 10.2912 | ms |
    94. | 90th percentile latency | percolator_with_content_president_bush | 13.3935 | ms |
    95. | 99th percentile latency | percolator_with_content_president_bush | 16.1495 | ms |
    96. | 100th percentile latency | percolator_with_content_president_bush | 16.4619 | ms |
    97. | 50th percentile service time | percolator_with_content_president_bush | 9.44676 | ms |
    98. | 90th percentile service time | percolator_with_content_president_bush | 12.2333 | ms |
    99. | 99th percentile service time | percolator_with_content_president_bush | 15.5729 | ms |
    100. | 100th percentile service time | percolator_with_content_president_bush | 15.6444 | ms |
    101. | error rate | percolator_with_content_president_bush | 0 | % |
    102. | Min Throughput | percolator_with_content_saddam_hussein | 50.07 | ops/s |
    103. | Mean Throughput | percolator_with_content_saddam_hussein | 50.07 | ops/s |
    104. | Median Throughput | percolator_with_content_saddam_hussein | 50.07 | ops/s |
    105. | Max Throughput | percolator_with_content_saddam_hussein | 50.08 | ops/s |
    106. | 50th percentile latency | percolator_with_content_saddam_hussein | 3.68269 | ms |
    107. | 90th percentile latency | percolator_with_content_saddam_hussein | 4.41383 | ms |
    108. | 99th percentile latency | percolator_with_content_saddam_hussein | 8.45466 | ms |
    109. | 100th percentile latency | percolator_with_content_saddam_hussein | 9.41373 | ms |
    110. | 50th percentile service time | percolator_with_content_saddam_hussein | 2.81123 | ms |
    111. | 90th percentile service time | percolator_with_content_saddam_hussein | 3.50136 | ms |
    112. | 99th percentile service time | percolator_with_content_saddam_hussein | 7.73842 | ms |
    113. | 100th percentile service time | percolator_with_content_saddam_hussein | 8.28083 | ms |
    114. | error rate | percolator_with_content_saddam_hussein | 0 | % |
    115. | Min Throughput | percolator_with_content_hurricane_katrina | 50.13 | ops/s |
    116. | Mean Throughput | percolator_with_content_hurricane_katrina | 50.15 | ops/s |
    117. | Median Throughput | percolator_with_content_hurricane_katrina | 50.15 | ops/s |
    118. | Max Throughput | percolator_with_content_hurricane_katrina | 50.17 | ops/s |
    119. | 50th percentile latency | percolator_with_content_hurricane_katrina | 8.31714 | ms |
    120. | 90th percentile latency | percolator_with_content_hurricane_katrina | 9.77985 | ms |
    121. | 99th percentile latency | percolator_with_content_hurricane_katrina | 11.9031 | ms |
    122. | 100th percentile latency | percolator_with_content_hurricane_katrina | 16.0777 | ms |
    123. | 50th percentile service time | percolator_with_content_hurricane_katrina | 6.9336 | ms |
    124. | 90th percentile service time | percolator_with_content_hurricane_katrina | 8.12209 | ms |
    125. | 99th percentile service time | percolator_with_content_hurricane_katrina | 11.4533 | ms |
    126. | 100th percentile service time | percolator_with_content_hurricane_katrina | 14.9582 | ms |
    127. | error rate | percolator_with_content_hurricane_katrina | 0 | % |
    128. | Min Throughput | percolator_with_content_google | 26.57 | ops/s |
    129. | Mean Throughput | percolator_with_content_google | 26.77 | ops/s |
    130. | Median Throughput | percolator_with_content_google | 26.76 | ops/s |
    131. | Max Throughput | percolator_with_content_google | 26.97 | ops/s |
    132. | 50th percentile latency | percolator_with_content_google | 83.5241 | ms |
    133. | 90th percentile latency | percolator_with_content_google | 104.656 | ms |
    134. | 99th percentile latency | percolator_with_content_google | 115.239 | ms |
    135. | 100th percentile latency | percolator_with_content_google | 119.399 | ms |
    136. | 50th percentile service time | percolator_with_content_google | 34.601 | ms |
    137. | 90th percentile service time | percolator_with_content_google | 44.8482 | ms |
    138. | 99th percentile service time | percolator_with_content_google | 52.8977 | ms |
    139. | 100th percentile service time | percolator_with_content_google | 53.925 | ms |
    140. | error rate | percolator_with_content_google | 0 | % |
    141. | Min Throughput | percolator_no_score_with_content_google | 99.79 | ops/s |
    142. | Mean Throughput | percolator_no_score_with_content_google | 99.79 | ops/s |
    143. | Median Throughput | percolator_no_score_with_content_google | 99.79 | ops/s |
    144. | Max Throughput | percolator_no_score_with_content_google | 99.79 | ops/s |
    145. | 50th percentile latency | percolator_no_score_with_content_google | 3.85806 | ms |
    146. | 90th percentile latency | percolator_no_score_with_content_google | 4.32838 | ms |
    147. | 99th percentile latency | percolator_no_score_with_content_google | 4.84981 | ms |
    148. | 100th percentile latency | percolator_no_score_with_content_google | 5.66612 | ms |
    149. | 50th percentile service time | percolator_no_score_with_content_google | 2.98046 | ms |
    150. | 90th percentile service time | percolator_no_score_with_content_google | 3.37479 | ms |
    151. | 99th percentile service time | percolator_no_score_with_content_google | 4.04749 | ms |
    152. | 100th percentile service time | percolator_no_score_with_content_google | 5.13068 | ms |
    153. | error rate | percolator_no_score_with_content_google | 0 | % |
    154. | Min Throughput | percolator_with_highlighting | 48.79 | ops/s |
    155. | Mean Throughput | percolator_with_highlighting | 48.94 | ops/s |
    156. | Median Throughput | percolator_with_highlighting | 48.94 | ops/s |
    157. | Max Throughput | percolator_with_highlighting | 49.09 | ops/s |
    158. | 50th percentile latency | percolator_with_highlighting | 5.55708 | ms |
    159. | 90th percentile latency | percolator_with_highlighting | 6.13534 | ms |
    160. | 99th percentile latency | percolator_with_highlighting | 10.0739 | ms |
    161. | 100th percentile latency | percolator_with_highlighting | 21.7479 | ms |
    162. | 50th percentile service time | percolator_with_highlighting | 4.72898 | ms |
    163. | 90th percentile service time | percolator_with_highlighting | 5.13776 | ms |
    164. | 99th percentile service time | percolator_with_highlighting | 9.4044 | ms |
    165. | 100th percentile service time | percolator_with_highlighting | 21.1273 | ms |
    166. | error rate | percolator_with_highlighting | 0 | % |
    167. | Min Throughput | percolator_with_content_ignore_me | 0.08 | ops/s |
    168. | Mean Throughput | percolator_with_content_ignore_me | 0.08 | ops/s |
    169. | Median Throughput | percolator_with_content_ignore_me | 0.08 | ops/s |
    170. | Max Throughput | percolator_with_content_ignore_me | 0.08 | ops/s |
    171. | 50th percentile latency | percolator_with_content_ignore_me | 10721.8 | ms |
    172. | 90th percentile latency | percolator_with_content_ignore_me | 11339.3 | ms |
    173. | 99th percentile latency | percolator_with_content_ignore_me | 11920.1 | ms |
    174. | 100th percentile latency | percolator_with_content_ignore_me | 12114.7 | ms |
    175. | 50th percentile service time | percolator_with_content_ignore_me | 10719.2 | ms |
    176. | 90th percentile service time | percolator_with_content_ignore_me | 11337.3 | ms |
    177. | 99th percentile service time | percolator_with_content_ignore_me | 11916.3 | ms |
    178. | 100th percentile service time | percolator_with_content_ignore_me | 12112 | ms |
    179. | error rate | percolator_with_content_ignore_me | 0 | % |
    180. | Min Throughput | percolator_no_score_with_content_ignore_me | 15.03 | ops/s |
    181. | Mean Throughput | percolator_no_score_with_content_ignore_me | 15.05 | ops/s |
    182. | Median Throughput | percolator_no_score_with_content_ignore_me | 15.05 | ops/s |
    183. | Max Throughput | percolator_no_score_with_content_ignore_me | 15.06 | ops/s |
    184. | 50th percentile latency | percolator_no_score_with_content_ignore_me | 31.3156 | ms |
    185. | 90th percentile latency | percolator_no_score_with_content_ignore_me | 50.9371 | ms |
    186. | 99th percentile latency | percolator_no_score_with_content_ignore_me | 58.0967 | ms |
    187. | 100th percentile latency | percolator_no_score_with_content_ignore_me | 58.1975 | ms |
    188. | 50th percentile service time | percolator_no_score_with_content_ignore_me | 30.048 | ms |
    189. | 90th percentile service time | percolator_no_score_with_content_ignore_me | 49.9852 | ms |
    190. | 99th percentile service time | percolator_no_score_with_content_ignore_me | 57.0299 | ms |
    191. | 100th percentile service time | percolator_no_score_with_content_ignore_me | 57.3463 | ms |
    192. | error rate | percolator_no_score_with_content_ignore_me | 0 | % |
    193. [WARNING] No throughput metrics available for [index]. Likely cause: The benchmark ended already during warmup.
    194. ----------------------------------
    195. [INFO] SUCCESS (took 1691 seconds)
    196. ----------------------------------
  • 相关阅读:
    [Typescript]基础篇之 String 对象
    企业内网DNS搭建,SmartDNS,网站访问加速,解决dns污染等问题
    [Android开发学iOS系列] iOS项目环境搭建和依赖管理
    Gradle多模块项目配置
    【蓝桥杯入门记录】动态数码管例程
    【FreeRTOS】多任务创建
    CMake中list的使用
    多维时序 | MATLAB实现TCN时间卷积神经网络多变量时间序列预测
    API(十一) 获取openresty编译信息
    【shell】$# 获取函数参数
  • 原文地址:https://blog.csdn.net/star1210644725/article/details/125611675