store.asciidoc 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [[index-modules-store]]
  2. == Store
  3. The store module allows you to control how index data is stored.
  4. The index can either be stored in-memory (no persistence) or on-disk
  5. (the default). In-memory indices provide better performance at the cost
  6. of limiting the index size to the amount of available physical memory.
  7. When using a local gateway (the default), file system storage with *no*
  8. in memory storage is required to maintain index consistency. This is
  9. required since the local gateway constructs its state from the local
  10. index state of each node.
  11. Another important aspect of memory based storage is the fact that
  12. Elasticsearch supports storing the index in memory *outside of the JVM
  13. heap space* using the "Memory" (see below) storage type. It translates
  14. to the fact that there is no need for extra large JVM heaps (with their
  15. own consequences) for storing the index in memory.
  16. experimental[All of the settings exposed in the `store` module are expert only and may be removed in the future]
  17. [float]
  18. [[file-system]]
  19. === File system storage types
  20. File system based storage is the default storage used. There are
  21. different implementations or _storage types_. The best one for the
  22. operating environment will be automatically chosen: `mmapfs` on
  23. Windows 64bit, `simplefs` on Windows 32bit, and `default`
  24. (hybrid `niofs` and `mmapfs`) for the rest.
  25. This can be overridden for all indices by adding this to the
  26. `config/elasticsearch.yml` file:
  27. [source,yaml]
  28. ---------------------------------
  29. index.store.type: niofs
  30. ---------------------------------
  31. It can also be set on a per-index basis at index creation time:
  32. [source,json]
  33. ---------------------------------
  34. curl -XPUT localhost:9200/my_index -d '{
  35. "settings": {
  36. "index.store.type": "niofs"
  37. }
  38. }';
  39. ---------------------------------
  40. The following sections lists all the different storage types supported.
  41. [float]
  42. [[simplefs]]
  43. ==== Simple FS
  44. The `simplefs` type is a straightforward implementation of file system
  45. storage (maps to Lucene `SimpleFsDirectory`) using a random access file.
  46. This implementation has poor concurrent performance (multiple threads
  47. will bottleneck). It is usually better to use the `niofs` when you need
  48. index persistence.
  49. [float]
  50. [[niofs]]
  51. ==== NIO FS
  52. The `niofs` type stores the shard index on the file system (maps to
  53. Lucene `NIOFSDirectory`) using NIO. It allows multiple threads to read
  54. from the same file concurrently. It is not recommended on Windows
  55. because of a bug in the SUN Java implementation.
  56. [[mmapfs]]
  57. [float]
  58. ==== MMap FS
  59. The `mmapfs` type stores the shard index on the file system (maps to
  60. Lucene `MMapDirectory`) by mapping a file into memory (mmap). Memory
  61. mapping uses up a portion of the virtual memory address space in your
  62. process equal to the size of the file being mapped. Before using this
  63. class, be sure your have plenty of virtual address space.
  64. See <<vm-max-map-count>>
  65. [[default_fs]]
  66. [float]
  67. ==== Hybrid MMap / NIO FS
  68. The `default` type stores the shard index on the file system depending on
  69. the file type by mapping a file into memory (mmap) or using Java NIO. Currently
  70. only the Lucene term dictionary and doc values files are memory mapped to reduce
  71. the impact on the operating system. All other files are opened using Lucene `NIOFSDirectory`.
  72. Address space settings (<<vm-max-map-count>>) might also apply if your term
  73. dictionaries are large.