Skip to content

Commit

Permalink
Explicitly sets replicas and shards to 1 for ISM history indices (ope…
Browse files Browse the repository at this point in the history
  • Loading branch information
dbbaughe committed Nov 13, 2020
1 parent 9d44bbb commit a8b726c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class IndexStateManagementHistory(
val request = RolloverRequest(IndexStateManagementIndices.HISTORY_WRITE_INDEX_ALIAS, null)
request.createIndexRequest.index(IndexStateManagementIndices.HISTORY_INDEX_PATTERN)
.mapping(_DOC, IndexStateManagementIndices.indexStateManagementHistoryMappings, XContentType.JSON)
.settings(Settings.builder().put("index.hidden", true).put("index.number_of_shards", 1).put("index.number_of_replicas", 1))
request.addMaxIndexDocsCondition(historyMaxDocs)
request.addMaxIndexAgeCondition(historyMaxAge)
val response = client.admin().indices().rolloverIndex(request).actionGet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class IndexStateManagementIndices(

val request = CreateIndexRequest(index)
.mapping(_DOC, indexStateManagementHistoryMappings, XContentType.JSON)
.settings(Settings.builder().put("index.hidden", true).build())
.settings(Settings.builder().put("index.hidden", true)
.put("index.number_of_shards", 1).put("index.number_of_replicas", 1).build())
if (alias != null) request.alias(Alias(alias))
return try {
val createIndexResponse: CreateIndexResponse = client.suspendUntil { client.create(request, it) }
Expand Down

0 comments on commit a8b726c

Please sign in to comment.