store-smb.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. [[store-smb]]
  2. === Store SMB Plugin
  3. The Store SMB plugin works around for a bug in Windows SMB and Java on windows.
  4. :plugin_name: store-smb
  5. include::install_remove.asciidoc[]
  6. [[store-smb-usage]]
  7. ==== Working around a bug in Windows SMB and Java on windows
  8. When using a shared file system based on the SMB protocol (like Azure File Service) to store indices, the way Lucene
  9. open index segment files is with a write only flag. This is the _correct_ way to open the files, as they will only be
  10. used for writes and allows different FS implementations to optimize for it. Sadly, in windows with SMB, this disables
  11. the cache manager, causing writes to be slow. This has been described in
  12. https://issues.apache.org/jira/browse/LUCENE-6176[LUCENE-6176], but it affects each and every Java program out there!.
  13. This need and must be fixed outside of ES and/or Lucene, either in windows or OpenJDK. For now, we are providing an
  14. experimental support to open the files with read flag, but this should be considered experimental and the correct way
  15. to fix it is in OpenJDK or Windows.
  16. The Store SMB plugin provides two storage types optimized for SMB:
  17. `smb_mmap_fs`::
  18. a SMB specific implementation of the default
  19. {ref}/index-modules-store.html#mmapfs[mmap fs]
  20. `smb_simple_fs`::
  21. a SMB specific implementation of the default
  22. {ref}/index-modules-store.html#simplefs[simple fs]
  23. To use one of these specific storage types, you need to install the Store SMB plugin and restart the node.
  24. Then configure Elasticsearch to set the storage type you want.
  25. This can be configured for all indices by adding this to the `elasticsearch.yml` file:
  26. [source,yaml]
  27. ----
  28. index.store.type: smb_simple_fs
  29. ----
  30. Note that setting will be applied for newly created indices.
  31. It can also be set on a per-index basis at index creation time:
  32. [source,console]
  33. ----
  34. PUT my-index-000001
  35. {
  36. "settings": {
  37. "index.store.type": "smb_mmap_fs"
  38. }
  39. }
  40. ----