Hi,
I have Aws elastic search cluster with two nodes. The data is being pushed from fluentd to elastic search. By default all the indexs have 5 primary shards and 1 replica. And i want to resize the no of primary shards to 2 for the new indexes. "I know i can use shrunk api for older indices"
Where can i do this. Indices are created by fluentd itself.
I don't think you can reduce a 5 shards index to 2 shards. You would need to reindex instead in a new index.
But you can reduce to 1 shard I think. Here is a typical script to do that on an index INDEX in a cluster which has a node with name NODE1:
# Read only and move primaries to one single node and no replica
PUT /INDEX/_settings
{
"settings": {
"index.number_of_replicas": 0,
"index.routing.allocation.require._name": "NODE1",
"index.blocks.write": true
}
}
# Check shards allocation
GET /_cat/shards/INDEX*?v&h=index,shard,prirep,state,docs,node
# Shrink the index
POST /INDEX/_shrink/INDEX_shrunk
{
"settings": {
"index.routing.allocation.require._name": null,
"index.blocks.write": null,
"index.number_of_replicas": 1,
"index.number_of_shards": 1
}
}
Check the fluentd documentation. May be you need to change an index template...
Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named Observability, Security, Enterprise Search and what is coming next ...
I dont want to change shard count for previous indexes . I only want to chnage the or restrict primary shard count to 2 for the new indexes which are going to come in. Is there a way to do that from elastic side. Or it should be done from fluentd end? Note: Fluentd is creating the index as the data coming into it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.