2013-08-28 19:24:34 -04:00
|
|
|
[[modules-memcached]]
|
|
|
|
== memcached
|
|
|
|
|
2017-11-29 03:44:25 -05:00
|
|
|
The memcached module allows to expose *Elasticsearch*
|
2013-08-28 19:24:34 -04:00
|
|
|
APIs over the memcached protocol (as closely
|
|
|
|
as possible).
|
|
|
|
|
|
|
|
It is provided as a plugin called `transport-memcached` and installing
|
|
|
|
is explained
|
2016-03-03 14:03:05 -05:00
|
|
|
https://github.com/elastic/elasticsearch-transport-memcached[here]
|
2013-08-28 19:24:34 -04:00
|
|
|
. Another option is to download the memcached plugin and placing it
|
|
|
|
under the `plugins` directory.
|
|
|
|
|
|
|
|
The memcached protocol supports both the binary and the text protocol,
|
|
|
|
automatically detecting the correct one to use.
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
=== Mapping REST to Memcached Protocol
|
|
|
|
|
|
|
|
Memcached commands are mapped to REST and handled by the same generic
|
2017-11-29 03:44:25 -05:00
|
|
|
REST layer in Elasticsearch. Here is a list of the memcached commands
|
2013-08-28 19:24:34 -04:00
|
|
|
supported:
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
==== GET
|
|
|
|
|
|
|
|
The memcached `GET` command maps to a REST `GET`. The key used is the
|
|
|
|
URI (with parameters). The main downside is the fact that the memcached
|
|
|
|
`GET` does not allow body in the request (and `SET` does not allow to
|
|
|
|
return a result...). For this reason, most REST APIs (like search) allow
|
|
|
|
to accept the "source" as a URI parameter as well.
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
==== SET
|
|
|
|
|
|
|
|
The memcached `SET` command maps to a REST `POST`. The key used is the
|
|
|
|
URI (with parameters), and the body maps to the REST body.
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
==== DELETE
|
|
|
|
|
|
|
|
The memcached `DELETE` command maps to a REST `DELETE`. The key used is
|
|
|
|
the URI (with parameters).
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
==== QUIT
|
|
|
|
|
|
|
|
The memcached `QUIT` command is supported and disconnects the client.
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
=== Settings
|
|
|
|
|
|
|
|
The following are the settings the can be configured for memcached:
|
|
|
|
|
|
|
|
[cols="<,<",options="header",]
|
|
|
|
|===============================================================
|
|
|
|
|Setting |Description
|
|
|
|
|`memcached.port` |A bind port range. Defaults to `11211-11311`.
|
|
|
|
|===============================================================
|
|
|
|
|
2014-03-07 08:21:45 -05:00
|
|
|
It also uses the common
|
2013-08-28 19:24:34 -04:00
|
|
|
<<modules-network,network settings>>.
|
|
|
|
|
2020-07-23 12:42:33 -04:00
|
|
|
[discrete]
|
2013-08-28 19:24:34 -04:00
|
|
|
=== Disable memcached
|
|
|
|
|
|
|
|
The memcached module can be completely disabled and not started using by
|
|
|
|
setting `memcached.enabled` to `false`. By default it is enabled once it
|
|
|
|
is detected as a plugin.
|