---
title: 配置ESRally参数
description: "1. 打开JSON文件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengbds/testguide/tstg/kunpengbdses_11_0014.html
sourcePath: /source/zh/kunpengbds/testguide/tstg/kunpengbdses_11_0014.html
indexId: 29cebec876aed40fd5bfa1ca3ab687a5962d61f209787b989f1492fb467edf5262
---
# 配置ESRally参数

#### 配置index.json

1. 打开JSON文件。
  1 vi benchmarks/tracks/default/geonames/index.json

2. 按“i”进入编辑模式，文件内容替换如下所示。
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 { "settings": { "index.number_of_replicas": 0 }, "mappings": { "docs": { "dynamic": "strict", "properties": { "geonameid": { "type": "long" }, "name": { "type": "text" }, "latitude": { "type": "double" }, "longitude": { "type": "double" }, "country_code": { "type": "text" }, "population": { "type": "long" } } } } }

3. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。


#### 配置track.json

1. 查询track.json文件中所示部分代码中参数所需要的值。
  将查到的参数添加至对应的JSON文件对应的位置。 1 wc benchmarks/data/geonames/documents.json

2. 打开JSON文件。
  1 vi benchmarks/tracks/default/geonames/track.json

3. 按“i”进入编辑模式，文件内容替换如下所示。
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 { "version": 2, "description": "Tutorial benchmark for Rally", "indices": [ { "name": "geonames", "body": "index.json", "types": [ "docs" ] } ], "corpora": [ { "name": "geonames", "documents": [ { "source-file": "documents.json", "document-count": 11658903, "uncompressed-bytes": 1544799789 } ] } ], "schedule": [ { "operation": { "operation-type": "delete-index" } }, { "operation": { "operation-type": "create-index" } }, { "operation": { "operation-type": "cluster-health", "request-params": { "wait_for_status": "green" } } }, { "operation": { "operation-type": "bulk", "bulk-size": 5000 }, "warmup-time-period": 120, "clients": 8 }, { "operation": { "operation-type": "force-merge" } }, { "operation": { "name": "query-match-all", "operation-type": "search", "body": { "query": { "match_all": {} } } }, "clients": 8, "warmup-iterations": 1000, "iterations": 1000, "target-throughput": 100 } ] }

  track.json文件中参数对应值分别为如下： source-file：生成数据集的名称。 document-count：数据集的行数。 uncompressed-bytes：数据文件的字节大小。

4. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
