Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Explicitly sets replicas and shards to 1 for ISM history indices (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbbaughe committed Nov 13, 2020
1 parent ffef7a0 commit 54523da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class IndexManagementIndices(

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
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class IndexStateManagementHistory(
// We have to pass null for newIndexName in order to get Elastic to increment the index count.
val request = RolloverRequest(IndexManagementIndices.HISTORY_WRITE_INDEX_ALIAS, null)
request.createIndexRequest.index(IndexManagementIndices.HISTORY_INDEX_PATTERN)
.mapping(_DOC,
IndexManagementIndices.indexStateManagementHistoryMappings, XContentType.JSON)
.mapping(_DOC, IndexManagementIndices.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

0 comments on commit 54523da

Please sign in to comment.