index.asciidoc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. [[river]]
  2. = Rivers
  3. == Intro
  4. deprecated[1.5.0,Rivers have been deprecated. See https://www.elastic.co/blog/deprecating_rivers for more details]
  5. A river is a pluggable service running within elasticsearch cluster
  6. pulling data (or being pushed with data) that is then indexed into the
  7. cluster.
  8. A river is composed of a unique name and a type. The type is the type of
  9. the river (out of the box, there is the `dummy` river that simply logs
  10. that it is running). The name uniquely identifies the river within the
  11. cluster. For example, one can run a river called `my_river` with type
  12. `dummy`, and another river called `my_other_river` with type `dummy`.
  13. [[how-it-works]]
  14. == How it Works
  15. A river instance (and its name) is a type within the `_river` index. All
  16. different rivers implementations accept a document called `_meta` that
  17. at the very least has the type of the river (twitter / couchdb / ...)
  18. associated with it. Creating a river is a simple curl request to index
  19. that `_meta` document (there is actually a `dummy` river used for
  20. testing):
  21. [source,js]
  22. --------------------------------------------------
  23. curl -XPUT 'localhost:9200/_river/my_river/_meta' -d '{
  24. "type" : "dummy"
  25. }'
  26. --------------------------------------------------
  27. A river can also have more data associated with it in the form of more
  28. documents indexed under the given index type (the river name). For
  29. example, storing the last indexed state can be stored in a document that
  30. holds it.
  31. Deleting a river is a call to delete the type (and all documents
  32. associated with it):
  33. [source,js]
  34. --------------------------------------------------
  35. curl -XDELETE 'localhost:9200/_river/my_river/'
  36. --------------------------------------------------
  37. [[allocation]]
  38. == Cluster Allocation
  39. Rivers are singletons within the cluster. They get allocated
  40. automatically to one of the nodes and run. If that node fails, a river
  41. will be automatically allocated to another node.
  42. River allocation on nodes can be controlled on each node. The
  43. `node.river` can be set to `_none_` disabling any river allocation to
  44. it. The `node.river` can also include a comma separated list of either
  45. river names or types controlling the rivers allowed to run on it. For
  46. example: `my_river1,my_river2`, or `dummy,twitter`.
  47. [[status]]
  48. == Status
  49. Each river (regardless of the implementation) exposes a high level
  50. `_status` doc which includes the node the river is running on. Getting
  51. the status is a simple curl GET request to
  52. `/_river/{river name}/_status`.
  53. include::couchdb.asciidoc[]
  54. include::rabbitmq.asciidoc[]
  55. include::twitter.asciidoc[]
  56. include::wikipedia.asciidoc[]