http.asciidoc 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [[modules-http]]
  2. == HTTP
  3. The http module allows to expose *elasticsearch* APIs
  4. over HTTP.
  5. The http mechanism is completely asynchronous in nature, meaning that
  6. there is no blocking thread waiting for a response. The benefit of using
  7. asynchronous communication for HTTP is solving the
  8. http://en.wikipedia.org/wiki/C10k_problem[C10k problem].
  9. When possible, consider using
  10. http://en.wikipedia.org/wiki/Keepalive#HTTP_Keepalive[HTTP keep alive]
  11. when connecting for better performance and try to get your favorite
  12. client not to do
  13. http://en.wikipedia.org/wiki/Chunked_transfer_encoding[HTTP chunking].
  14. [float]
  15. === Settings
  16. The following are the settings the can be configured for HTTP:
  17. [cols="<,<",options="header",]
  18. |=======================================================================
  19. |Setting |Description
  20. |`http.port` |A bind port range. Defaults to `9200-9300`.
  21. |`http.max_content_length` |The max content of an HTTP request. Defaults
  22. to `100mb`
  23. |`http.max_initial_line_length` |The max length of an HTTP URL. Defaults
  24. to `4kb`
  25. |`http.compression` |Support for compression when possible (with
  26. Accept-Encoding). Defaults to `false`.
  27. |`http.compression_level` |Defines the compression level to use.
  28. Defaults to `6`.
  29. |`http.cors.enabled` |Enable or disable cross-origin resource sharing,
  30. i.e. whether a browser on another origin can do requests to
  31. Elasticsearch. Defaults to `true`.
  32. |`http.cors.allow-origin` |Which origins to allow. Defaults to `*`,
  33. i.e. any origin.
  34. |`http.cors.max-age` |Browsers send a "preflight" OPTIONS-request to
  35. determine CORS settings. `max-age` defines how long the result should
  36. be cached for. Defaults to `1728000` (20 days)
  37. |`http.cors.allow-methods` |Which methods to allow. Defaults to
  38. `OPTIONS, HEAD, GET, POST, PUT, DELETE`.
  39. |`http.cors.allow-headers` |Which headers to allow. Defaults to
  40. `X-Requested-With, Content-Type, Content-Length`.
  41. |=======================================================================
  42. It also uses the common
  43. <<modules-network,network settings>>.
  44. [float]
  45. === Disable HTTP
  46. The http module can be completely disabled and not started by setting
  47. `http.enabled` to `false`. This make sense when creating non
  48. <<modules-node,data nodes>> which accept HTTP
  49. requests, and communicate with data nodes using the internal
  50. <<modules-transport,transport>>.