2013-08-28 19:24:34 -04:00
|
|
|
[[index-modules-store]]
|
|
|
|
== Store
|
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
The store module allows you to control how index data is stored and accessed on disk.
|
2015-01-14 05:35:09 -05:00
|
|
|
|
2013-08-28 19:24:34 -04:00
|
|
|
[float]
|
2013-09-25 12:17:40 -04:00
|
|
|
[[file-system]]
|
2014-06-12 07:56:06 -04:00
|
|
|
=== File system storage types
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
There are different file system implementations or _storage types_. The best
|
2016-05-04 02:51:37 -04:00
|
|
|
one for the operating environment will be automatically chosen: `simplefs` on
|
|
|
|
Windows 32bit, `niofs` on other 32bit systems and `mmapfs` on 64bit systems.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2014-06-12 07:56:06 -04:00
|
|
|
This can be overridden for all indices by adding this to the
|
|
|
|
`config/elasticsearch.yml` file:
|
|
|
|
|
|
|
|
[source,yaml]
|
|
|
|
---------------------------------
|
|
|
|
index.store.type: niofs
|
|
|
|
---------------------------------
|
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
It is a _static_ setting that can be set on a per-index basis at index
|
|
|
|
creation time:
|
2014-06-12 07:56:06 -04:00
|
|
|
|
2015-07-14 12:14:09 -04:00
|
|
|
[source,js]
|
2014-06-12 07:56:06 -04:00
|
|
|
---------------------------------
|
2015-06-22 17:49:45 -04:00
|
|
|
PUT /my_index
|
|
|
|
{
|
|
|
|
"settings": {
|
|
|
|
"index.store.type": "niofs"
|
|
|
|
}
|
|
|
|
}
|
2014-06-12 07:56:06 -04:00
|
|
|
---------------------------------
|
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
experimental[This is an expert-only setting and may be removed in the future]
|
|
|
|
|
2014-06-12 07:56:06 -04:00
|
|
|
The following sections lists all the different storage types supported.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
[[simplefs]]`simplefs`::
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
The Simple FS type is a straightforward implementation of file system
|
2013-08-28 19:24:34 -04:00
|
|
|
storage (maps to Lucene `SimpleFsDirectory`) using a random access file.
|
|
|
|
This implementation has poor concurrent performance (multiple threads
|
|
|
|
will bottleneck). It is usually better to use the `niofs` when you need
|
|
|
|
index persistence.
|
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
[[niofs]]`niofs`::
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
The NIO FS type stores the shard index on the file system (maps to
|
2013-08-28 19:24:34 -04:00
|
|
|
Lucene `NIOFSDirectory`) using NIO. It allows multiple threads to read
|
|
|
|
from the same file concurrently. It is not recommended on Windows
|
|
|
|
because of a bug in the SUN Java implementation.
|
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
[[mmapfs]]`mmapfs`::
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
The MMap FS type stores the shard index on the file system (maps to
|
2013-08-28 19:24:34 -04:00
|
|
|
Lucene `MMapDirectory`) by mapping a file into memory (mmap). Memory
|
|
|
|
mapping uses up a portion of the virtual memory address space in your
|
|
|
|
process equal to the size of the file being mapped. Before using this
|
2015-06-22 17:49:45 -04:00
|
|
|
class, be sure you have allowed plenty of
|
|
|
|
<<vm-max-map-count,virtual address space>>.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2016-05-04 02:51:37 -04:00
|
|
|
[[default_fs]]`default_fs` deprecated[5.0.0, The `default_fs` store type is deprecated - use `mmapfs` instead]::
|
2014-06-26 16:46:21 -04:00
|
|
|
|
2015-06-22 17:49:45 -04:00
|
|
|
The `default` type is a hybrid of NIO FS and MMapFS, which chooses the best
|
2016-05-04 02:51:37 -04:00
|
|
|
file system for each type of file. Currently only the Lucene term dictionary,
|
|
|
|
doc values and points files are memory mapped to reduce the impact on the
|
|
|
|
operating system. All other files are opened using Lucene `NIOFSDirectory`.
|
|
|
|
Address space settings (<<vm-max-map-count>>) might also apply if your term
|
|
|
|
dictionary are large, if you index many fields that use points (numerics, dates
|
|
|
|
and ip addresses) or if you have many fields with doc values.
|
2014-06-26 16:46:21 -04:00
|
|
|
|