$ ./bin/startServer.sh -r memcached
Starting with version 4.1, the Infinispan distribution contains a server module that implements the Memcached text protocol. This allows Memcached clients to talk to one or serveral Infinispan backed Memcached servers. These servers could either be working standalone just like Memcached does where each server acts independently and does not communicate with the rest, or they could be clustered where servers replicate or distribute their contents to other Infinispan backed Memcached servers, thus providing clients with failover capabilities.
The simplest way to start up an Infinispan memcached server is to simply unzip the all distribution and either run the startServer.bat or startServer.sh script passing memcached as the protocol to run. For example:
$ ./bin/startServer.sh -r memcached
You can optionally pass a set of parameters to the Infinispan Memcached server that allow you to configure different parts of the server. You can find detailed information in the server command line options article.
Please note that, since the Memcached protocol does not allow specifying a cache to use, the mapping between Infinispan Memcached server instances and Infinispan Cache instances is 1 to 1. Therefore, when passing an Infinispan configuration file to the Infinispan Memcache server, either define a named cache with name "memcachedCache" or modify the default cache configuration.
The memcached module makes use of the JMX statistics in the cache configuration. For example:
<default> ... <jmxStatistics enabled="true"/> ... </default>
Even in a clustered environment, flush_all command leads to the clearing of the Infinispan Memcached server where the call lands. There's no attempt to propagate this flush to other nodes in the cluster. This is done so that flush_all with delay use case can be reproduced with the Infinispan Memcached server. The aim of passing a delay to flush_all is so that different Memcached servers in a full can be flushed at different times, and hence avoid overloading the database with requests as a result of all Memcached servers being empty. For more info, check the Memcached text protocol section on flush_all.
This section explains those parts of the memcached text protocol that for one reason or the other, are not currently supported by the Infinispan based memcached implementation.
Due to difference in nature between the original memcached implementation which is C/C++ based and the Infinispan implementation which is Java based, there're some general purpose stats that are not supported. For these unsupported stats, Infinispan memcached server always returns 0.
Here's the list of currently unsupported stats:
pid
pointer_size
rusage_user
rusage_system
bytes
curr_connections
total_connections
connection_structures
auth_cmds
auth_errors
limit_maxbytes
threads
conn_yields
reclaimed
The settings statistics section of the text protocol has not been implemented due to its volatility.
Since the arguments that can be send to the Memcached server are not documented, Infinispan Memcached server does not support passing any arguments to stats command. If any parameters are passed, the Infinispan Memcached server will respond with a CLIENT_ERROR.
Memcached does no longer honor the optional hold time parameter to delete command and so the Infinispan based memcached server does not implement such feature either.
Verbosity command is not supported since Infinispan logging cannot be simplified to defining the logging level alone.