How to install Memcached on CentOS 6.x

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
773
Points
63
1. Install repo

Check your OS version
Read more guides here: https://forumweb.hosting/13638-how-to-check-centos-version.html

After check OS version, you can choose one of Repo as follows to install Memcached on your hosting

Code:
[B]#Centos 5.x_86[/B]

rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

[B]#Centos 5.x_x86_x64[/B]

rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

[B]#Centos 6.x_86[/B]

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 
[B]
#Centos 6.x_x86_64[/B]

rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
2. Install memcached
Code:
yum install memcached -y

3. Configure memcached

Using the command

Code:
/etc/sysconfig/memcached
For example:

Code:
PORT="11211"
USER="memcached"
MAXCONN="10024"
CACHESIZE="128"
OPTIONS="-1 127.0.0.1"
PORT : memcached uses port 1121

MAXCONN : maximum connections to your server

CACHESIZE : How much MB of ram for storing cache files

4. Restart memcached and auto start when booting your server

Code:
/etc/init.d/memcached start
/etc/init.d/memcached stop

chkconfig --levels 235 memcached on
5. Check memcached status

Code:
netstat -tulpn | grep :11211
For example, you should see these

Code:
[root@server /]# netstat -tulpn | grep :11211
tcp        0      0 0.0.0.0:11211               0.0.0.0:*                   LISTEN      12314/memcached
tcp        0      0 :::11211                    :::*                        LISTEN      12314/memcached
udp        0      0 0.0.0.0:11211               0.0.0.0:*                               12314/memcached
udp        0      0 :::11211                    :::*                                    12314/memcached
 
Older Threads
Replies
4
Views
3,608
Replies
3
Views
3,711
Replies
1
Views
2,388
Replies
3
Views
2,368

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top