Linux Administrator

How to Install Memcached on CentOS/RHEL Using DAG Rpmforge Repository

In my previous article I show how you can install memcached from source. If you are using RHEL and CentOS system you have another method besides installing memcached from source.

In this article I will show how you can easily install memcached on libevent using DAG rpmforge repository.

Install DAG Rpmforge repository

First of all you have to add the DAG repository on your system.

# vim /etc/yum.repos.d/dag.repos

Add the below lines:

name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=$releasever/en/$basearch/dag

Next you will also need to import the GPG Key from the repository to make it work correctly. Follow the below command.

# rpm --import

Once required repository added on your system now you can proceed forward with the next step.

Install Memcached

Now install memcached DAG provides rpms for both memcached and libevent follow the below command to install both.

# yum install memcached
Package                 Arch       Version          Repository        Size
memcached               x86_64     1.2.2-1.el4.rf   rpmforge           81 k
Installing for dependencies:
libevent                x86_64     1.3b-1.el4.rf    rpmforge          127 k

Memcached successfully installed on your system.

Configure Memcached

Next configure memcached the default configuration file can be found under /etc/sysconfig/memcached

# cat /etc/sysconfig/memcached

Above is the default memcached configuration. If you want to tune these you can easly change the parameter especially for CACHESIZE and set the maximum memory to allocate to memcached. You can use the OPTIONS line to add any other memcached command line parameters. If you want to listen memcached on private IP change the private IP and increase the max memory to 1GB like below:

# /etc/sysconfig/memcached

Save and close file.

You can also install the memcached from source. Follow the below link to install memcached from source.

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment