Elasticsearch Curator helps you to manage and curate your Elasticsearch Indices. I will show how to use the Curator in the following ways:
- Create Indexes
- Reindex Indexes
- Set Replica Counts on Indexes
- Delete Indexes
Install Elasticsearch Curator
Install Elasticsearch Curator as follows:
1 2 3 |
|
Populate the configuration whith your Elasticsearch Host details:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Action: Create Indices
Use Curator to Create Elasticsearch Indexes:
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 |
|
When Running curator, you can append --dry-run
to test your config/action without touching your data. To create these indexes:
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 |
|
Lets have a look at our indices to confirm that our indices was created:
1 2 3 4 5 6 |
|
Action: Reindex Indices based on Timestring
I would like to reindex a months worth of index data to a monthly index:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Running the Curator to reindex all last months data: web-app1-metrics-2017.11.{01-31}
to the index: web-app1-metrics-2017.11
:
1
|
|
Curator to Change Replica Counts on your Indices:
We will change all our indices settings to replica count of 2, that is matched with our prefix pattern. We are using wait_for_completion
so the job will only be completed once the replica count number is updated and data has been replicated to the replica shards.
Our action file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Using Curator to increase our replica count on all the matched indices:
1 2 3 4 |
|
Curator to Delete your Indices:
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 |
|
First we will execute a Dry Run:
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 |
|
Everything seems to be as expected, lets run the Curator without the Dry-Run mode:
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 |
|