store.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [[index-modules-store]]
  2. == Store
  3. The store module allows you to control how index data is stored and accessed on disk.
  4. [float]
  5. [[file-system]]
  6. === File system storage types
  7. There are different file system implementations or _storage types_. The best
  8. one for the operating environment will be automatically chosen: `mmapfs` on
  9. Windows 64bit, `simplefs` on Windows 32bit, and `default` (hybrid `niofs` and
  10. `mmapfs`) for the rest.
  11. This can be overridden for all indices by adding this to the
  12. `config/elasticsearch.yml` file:
  13. [source,yaml]
  14. ---------------------------------
  15. index.store.type: niofs
  16. ---------------------------------
  17. It is a _static_ setting that can be set on a per-index basis at index
  18. creation time:
  19. [source,js]
  20. ---------------------------------
  21. PUT /my_index
  22. {
  23. "settings": {
  24. "index.store.type": "niofs"
  25. }
  26. }
  27. ---------------------------------
  28. experimental[This is an expert-only setting and may be removed in the future]
  29. The following sections lists all the different storage types supported.
  30. [[simplefs]]`simplefs`::
  31. The Simple FS type is a straightforward implementation of file system
  32. storage (maps to Lucene `SimpleFsDirectory`) using a random access file.
  33. This implementation has poor concurrent performance (multiple threads
  34. will bottleneck). It is usually better to use the `niofs` when you need
  35. index persistence.
  36. [[niofs]]`niofs`::
  37. The NIO FS type stores the shard index on the file system (maps to
  38. Lucene `NIOFSDirectory`) using NIO. It allows multiple threads to read
  39. from the same file concurrently. It is not recommended on Windows
  40. because of a bug in the SUN Java implementation.
  41. [[mmapfs]]`mmapfs`::
  42. The MMap FS type stores the shard index on the file system (maps to
  43. Lucene `MMapDirectory`) by mapping a file into memory (mmap). Memory
  44. mapping uses up a portion of the virtual memory address space in your
  45. process equal to the size of the file being mapped. Before using this
  46. class, be sure you have allowed plenty of
  47. <<vm-max-map-count,virtual address space>>.
  48. [[default_fs]]`default_fs`::
  49. The `default` type is a hybrid of NIO FS and MMapFS, which chooses the best
  50. file system for each type of file. Currently only the Lucene term dictionary
  51. and doc values files are memory mapped to reduce the impact on the operating
  52. system. All other files are opened using Lucene `NIOFSDirectory`. Address
  53. space settings (<<vm-max-map-count>>) might also apply if your term
  54. dictionaries are large.