Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.0Mb
PDF (A4) - 31.0Mb
PDF (RPM) - 29.3Mb
HTML Download (TGZ) - 7.2Mb
HTML Download (Zip) - 7.2Mb
HTML Download (RPM) - 6.2Mb
Man Pages (TGZ) - 175.7Kb
Man Pages (Zip) - 286.0Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb
Excerpts from this Manual

16.2.1 Installing memcached

You can build and install memcached from the source code directly, or you can use an existing operating system package or installation.

Installing memcached from a Binary Distribution

To install memcached on a Red Hat, or Fedora host, use yum:

root-shell> yum install memcached

On CentOS, you may be able to obtain a suitable RPM from another source, or use the source tarball.

To install memcached on a Debian or Ubuntu host, use apt-get:

root-shell> apt-get install memcached

To install memcached on a Gentoo host, use emerge:

root-shell> emerge install memcached

Building memcached from Source

On other Unix-based platforms, including Solaris, AIX, HP-UX and OS X, and Linux distributions not mentioned already, you must install from source. For Linux, make sure you have a 2.6-based kernel, which includes the improved epoll interface. For all platforms, ensure that you have libevent 1.1 or higher installed. You can obtain libevent from libevent web page.

You can obtain the source for memcached from memcached website.

To build memcached, follow these steps:

  1. Extract the memcached source package:

    shell> gunzip -c memcached-1.2.5.tar.gz | tar xf -
  2. Change to the memcached-1.2.5 directory:

    shell> cd memcached-1.2.5
  3. Run configure

    shell> ./configure

    Some additional options you might specify to the configure:

    • --prefix

      To specify a different installation directory, use the --prefix option:

      shell> ./configure --prefix=/opt

      The default is to use the /usr/local directory.

    • --with-libevent

      If you have installed libevent and configure cannot find the library, use the --with-libevent option to specify the location of the installed library.

    • --enable-64bit

      To build a 64-bit version of memcached (which enables you to use a single instance with a large RAM allocation), use --enable-64bit.

    • --enable-threads

      To enable multithreading support in memcached, which improves the response times on servers with a heavy load, use --enable-threads. You must have support for the POSIX threads within your operating system to enable thread support. For more information on the threading support, see Section, “memcached Thread Support”.

    • --enable-dtrace

      memcached includes a range of DTrace threads that can be used to monitor and benchmark a memcached instance. For more information, see Section, “Using memcached and DTrace”.

  4. Run make to build memcached:

    shell> make
  5. Run make install to install memcached:

    shell> make install

User Comments
  Posted by Bennett Haselton on June 28, 2009
The doc says that you can install memcached on CentOS just by typing "yum install memcached" but on my system I had to do two things first.

First, determine if you're on CentOS 4.x or 5.x by typing "cat /etc/*release*".

If on CentOS 4.x, then install the public key for the DAG repository by typing:
rpm -Uhv

If on CentOS 5.x, then install the public key for the DAG repository by typing:
rpm -Uhv rpm -Uhv

Then, under either version, create a file at /etc/yum.repos.d/dag.repo with these lines in it:
name=Dag RPM Repository for Red Hat Enterprise Linux

Then type "yum install memcached" and it should work. (Note: I don't know much about this, this is what I distilled from over an hour of trying to find correct information on the Web, almost all of it was incomplete or wrong. However, the steps above worked for me.)
Sign Up Login You must be logged in to post a comment.