-
Notifications
You must be signed in to change notification settings - Fork 9
Home
There are 3 usual steps to running esBench:
esBech contains many properties, all defined with defaults however few of them need to be changed for every user. Such properties are f.e ElasticSearch host, cluster.name, index, type since they will vary. For that purpose esBench support multi-tier property handling which is evaluated in this order:
- A) Tool default properties - build-in properties for case when user won't define a property. Explanation for every property and default values can be visited at default.properties
- B) Properties from configuration file defined by
--conf=my_conf_file
- C) Command line parameters - esBench accepts parameters with '--', f.e --index=my_index
In a nutshell we recommend to create your own configuration file by copying default.properties (located at examples/default.properties in esBench bundle) and modifying it based on your Elasticsearch cluster.
First step is to choose existing index from which esBench creates workload. Workload in esBench notation represents metadata information about index. Workload contains info about index types and fields with prescription how to generate field values.
esbench collect --host=localhost --index=board_games --type=game --workload=workloads/gb_histo.json
Or alternatively you can execute: esbench collect --conf=conf/bg_config.properties
where bg_config.properties will contain following values:
host=localhost
index=board_games
type=game
workload=workloads/gb_histo.json
Once esBench finish collection, user can check out/evaluate results. Workload file is written in JSON format, the core information is at histogram/fields
element where all Elasticsearch fields are listed.
User can simply add/edit/remove values to make document generation more precise.
This step is ideal with customer issues, where developer can ask customer for workload collection and customer can evaluate and remove any sensitive tokens/information from workload. Developer afterwards can generate documents in his development environment.
For more information, please refer to detail
The last step is to actually generate and send those generated documents to Elasticsearch. esBench will take workload and start creating documents and field values based on workload's field definition shown in Step 2. Evaluate/Modify workload.
esbench insert --index=board_games --type=game --workload=workloads/gb_histo.json --insert.docs=100 --insert.threads=4
More details can be found at Detail to insert
NOTE If you need faster and more powerful insert, please take a lot at clustered insert
Example 01: Collect workload from localhost cluster named elasticsearch of index Games and type board_game and send 100 generated documents (default value) to remote Elastic cluster named production to index board_game and type game
esbench collect --index=Games --type=board_game --workload=workloads/workload.json
esbench insert --cluster.name=production --host=192.168.1.101 --index=board_game --type=game --workload=workloads/workload.json --
Example 02: Collect workload from localhost cluster named elasticsearch of index Games for all types and send 5000 generated documents to the same index, type game using type from workload configuration named raw
esbench collect --index=Games
esbench insert --index=Games --type=game --workload.type=raw --insert.docs=5000