The index.store.type
setting in Elasticsearch controls the type of storage implementation used for the index. It determines how Elasticsearch stores and retrieves index data on disk.
- Default value: "fs" (filesystem)
- Possible values: "fs", "niofs", "mmapfs", "hybridfs"
- Recommendations: The default "fs" is suitable for most use cases. Consider alternatives for specific performance requirements or hardware configurations.
Example and Effects
To set the store type for a new index:
PUT /my_index
{
"settings": {
"index": {
"store": {
"type": "niofs"
}
}
}
}
Changing to "niofs" might improve performance on some systems, particularly those with many concurrent I/O operations. However, the impact can vary depending on the hardware and workload.
Common Issues and Misuses
- Changing the store type without understanding the implications for your specific hardware and workload.
- Assuming that a non-default store type will always improve performance.
Do's and Don'ts
Do:
- Test different store types in a non-production environment before making changes.
- Monitor performance metrics when changing the store type.
- Consider your hardware specifications when selecting a store type.
Don't:
- Change the store type on a production cluster without thorough testing.
- Assume that one store type is universally better than others.
- Ignore the potential impact on durability when selecting a store type.
Frequently Asked Questions
Q: Can I change the index.store.type for an existing index?
A: No, the store type cannot be changed for an existing index. You would need to reindex the data into a new index with the desired store type.
Q: What's the difference between "fs" and "niofs"?
A: "fs" uses the default file system implementation, while "niofs" uses NIO (New I/O) for potentially improved concurrent access performance.
Q: Is "mmapfs" always faster than other store types?
A: Not necessarily. While "mmapfs" can offer better performance in some scenarios, it depends on your specific hardware, workload, and available system memory.
Q: How does the store type affect index recovery time?
A: Different store types can affect recovery time, with some potentially offering faster recovery. However, this can vary based on hardware and index size.
Q: Can using a different store type help with index fragmentation?
A: The store type itself doesn't directly address index fragmentation. Fragmentation is more related to how Elasticsearch manages segments and merges.