Flings
Apps and tools built by our engineers that are intended to be played with and explored.

gemcached

gemcached

Summary

gemcached is a memcached server written in Java that understands memcached’s ASCII protocol and translates it into GemFire operations.

At startup, gemcached server starts an embedded GemFire cache. memcached clients can then talk with the gemcached server, which will store data in GemFire. Using a gemcached server allows clients written in a variety of languages to communicate with a GemFire cache server. Since these are memcached clients they will not be able to GemFire’s client side features like continuous queries and register interest (Please use GemFire’s Java and .NET clients for these features). However all server side (peer-to-peer) features of GemFire such as horizontal scaling using data partitioning and multi-site WAN replication are available.

System Requirements

Same as system requirements for GemFire.

Instructions

How to start a standalone gemcached server:

1. Make sure that gemfire.jar and gemcached-0.1-RELEASE.jar are added to your CLASSPATH.
2. Start the gemcached server using the following command:
java com.gemstone.memcached.GemFireMemcachedServer -port=[port]
where port is the port where memcached clients can connect. (If port is not specified, then 11212 is used by default).

How to embed the gemcached server in your application:

In your application, you can start the gemcached server as follows:

GemFireMemcachedServer gemcached = new GemFireMemcachedServer(5555/*port*/);
gemcached.start();


Configuring GemFire:

By default gemcached creates a region named "gemcached" which is a RegionShortcut.PARTITION region. You can override the default configuration for the gemcachedregion by adding a cache.xml with the desired configuration to the working directory where you are running gemcached server. You can also override GemFire's default configuration by adding a modified gemfire.properties file to the gemcached server working directory.

Video

Change Log

In 0.2, you get the following:

  • Added support for client flags for an operation
  • Added support for quit command
  • Hostname shown when gemcached server starts

Engineers

Swapnil Bawaskar

Works in the Gemstone R&D group.

Add Comment

3 thoughts on “gemcached

  1. Sanjeev

    Hi,

    We downloaded the gemcached jar, but it does not seem to implement the memcached ascii protocol.
    Our memcached client that works with memcached does not work here.

    So to check things, we tried doing a telnet to the port that gemcached is running on (11212), but that didnt work either ( as in
    we could not run the memcached commands like add or get, like it is supposed to work with memcached protocol).

    And lastly, when using the -port option, it gives an error message.
    We tried things like -port=11222 and -port 11222 and -port11222 , etc but none of these worked.

    For our run, we ran without -port and it ran in the default port, but the bigger issue was that we could not run our memcached client and when we wanted to test it via telnet, that didnt work either.

    Reply
    1. swapnil

      Hi Sanjeev,
      which memcached client do you use? Can you please provide steps to reproduce with telnet?

      Thanks!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>