From 32ce12e79c24af45d31a337249b47fc4c4638e35 Mon Sep 17 00:00:00 2001 From: Rebecca J <149120653+rejanick@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:42:48 -0600 Subject: [PATCH] Update LogTypeService.java Changed the index settings for the .opensearch-sap-log-types-config index from the default of 5 primary shards to 1 reduce the overall number of shards created for the index. Signed-off-by: Rebecca J <149120653+rejanick@users.noreply.github.com> --- .../opensearch/securityanalytics/logtype/LogTypeService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/securityanalytics/logtype/LogTypeService.java b/src/main/java/org/opensearch/securityanalytics/logtype/LogTypeService.java index 9036f514d..553d3d0af 100644 --- a/src/main/java/org/opensearch/securityanalytics/logtype/LogTypeService.java +++ b/src/main/java/org/opensearch/securityanalytics/logtype/LogTypeService.java @@ -445,7 +445,8 @@ public void ensureConfigIndexIsInitialized(ActionListener listener) { isConfigIndexInitialized = false; Settings indexSettings = Settings.builder() .put("index.hidden", true) - .put("index.auto_expand_replicas", "0-all") + .put("number_of_shards", 1) // Setting pri shard count to 1 to reduce sharding overhead in large clusters since this index is set to auto-expand replicas "all" + .put("index.auto_expand_replicas", "0-all") .build(); CreateIndexRequest createIndexRequest = new CreateIndexRequest(); @@ -789,4 +790,4 @@ public void setLogTypeMappingVersion() { XContentHelper.convertToMap(JsonXContent.jsonXContent, logTypeIndexMapping(), false); this.logTypeMappingVersion = (int)((Map)logTypeConfigAsMap.get("_meta")).get("schema_version"); } -} \ No newline at end of file +}