Created
November 13, 2018 08:12
-
-
Save djptek/24e13c246f921cb88b460e54c4fc8d11 to your computer and use it in GitHub Desktop.
Template to set number of shards to 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # start with a clean install | |
| DELETE test_index | |
| DELETE _template/my_global_template | |
| #create an index | |
| PUT test_index | |
| GET test_index/_settings | |
| # if ES < 7.0 this will have 5 primary shards | |
| # remove the index | |
| DELETE test_index | |
| # add a global template | |
| PUT _template/my_global_template | |
| { | |
| "index_patterns": ["*"], | |
| "settings" : { | |
| "number_of_shards" : 1 | |
| }, | |
| "order" : 1 | |
| } | |
| #re-create the index | |
| PUT test_index | |
| GET test_index/_settings | |
| # new index will have 1 primary shard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment