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
5,425
Replies
3
Views
5,334
Replies
1
Views
3,460
Replies
3
Views
3,520
Latest Threads
Replies
1
Views
1,345
Replies
3
Views
1,118
Replies
1
Views
712
Replies
2
Views
1,297
Replies
1
Views
872
Recommended Threads
Replies
7
Views
4,525
Replies
43
Views
33,561
Replies
3
Views
12,692
  • Locked
Replies
0
Views
3,918

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