• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install Memcached Server on Fedora and RHEL/CentOS

{{postValue.id}}

To install Memcached Server

This article is about how to install process of Memcached Server on Fedora 17-12 and RHEL/CentOS 6.3/5.8 using YUM command. Memcached is memory object caching program. It is an open source program which helps to speed up the performance.

To Enable EPEL repository under RHEL/CentOS 6.3 or 5.8

For RHEL/CentOS 6 ( 64-Bit )
wget http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-7.noarch.rpm
rpm -Uvh epel-release-6-7.noarch.rpm

For RHEL/CentOS 6 ( 32-Bit )
wget http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-7.noarch.rpm
rpm -Uvh epel-release-6-7.noarch.rpm

For RHEL/CentOS 5 ( 64-Bit )
wget http://mirrors.kernel.org/fedora-epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm

For RHEL/CentOS 5 ( 32-Bit )
wget http://mirrors.kernel.org/fedora-epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm

To Install Memcached

The Memcached command can be installed using the YUM tool

[root@linuxhelp~]# yum install memcached
Loaded plugins: fastestmirror
Determining fastest mirrors
epel: kartolo.sby.datautama.net.id
Dependencies Resolved

=====================================================================================================
 Package            Arch                Version                    Repository                    Size
=====================================================================================================
Installing:            
memcached            i386                1.4.5-1.el5                epel                        71 k

Transaction Summary
=====================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 71 k
Is this ok [y/N]: y
Downloading Packages:
memcached-1.4.5-1.el5.i386.rpm                                                    |  71 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : memcached                                                                  1/1

Installed:
  memcached.i386 0:1.4.5-1.el5

Complete!

To configure Memcached

This is the basic configuration file for memcached server and we can edit the contents which suits our set up. Here I have configured to my own set up it can be varied.

[root@linuxhelp~]# vi /etc/sysconfig/memcached

To Set or update parameters
# Running on Port 11211
PORT=" 11211" 

# Start as memcached daemon
USER=" memcached" 

# Set max simultaneous connections to 1024
MAXCONN=" 1024" 

# Set Memory size to 2048 - 4GB(4096)
CACHESIZE=" 2048" 

#Set server IP address
OPTIONS=" 192.168.5.220" 

Here, I have changed the default port number 11211 to 11222 and mentioned server’ s IP address as 192.168.5.220

Options

PORT : Runs the memcached
USER : The start-up daemon for memcached service.
MAXCONN : The value used to set max simultaneous connections to 1024.
CACHESIZE : cache size memory can be set to 2048. For busy servers you can increase upto 4GB.

OPTIONS : Apache or Nginx web servers can connect by Setting IP address of the server

To start Memcached

To start and restart the Memcached daemon

[root@linuxhelp~]# chkconfig --levels 235 memcached on
[root@linuxhelp~]# /etc/init.d/memcached start
[root@linuxhelp~]# /etc/init.d/memcached restart

To stop and check status

/etc/init.d/memcached stop
/etc/init.d/memcached status

To Verify Memcached

[root@linuxhelp~]# netstat -tulpn | grep :11222

tcp        0      0 0.0.0:11222             0.0.0.0:*                   LISTEN      10388/memcached
udp        0      0 0.0.0.0:11222             0.0.0.0:*                               10388/memcached

To Check the stats of the server

memcached-tool 192.168.5.220 stats

To install Memcached PHP extension
yum install php-pecl-memcache

To install Memcached Perl Library

yum install perl-Cache-Memcached

To install Memcached Python Library
yum install python-memcached

To configure Firewall to Secure Memcached Server

vi /etc/sysconfig/iptables

To Enable access on IP

## Enable access on IP ranges from 172.16.1.1 to 172.16.1.10 for Port 11211 ##
# iptables -A INPUT -p tcp --destination-port 11211 -m state --state NEW -m iprange --src-range 192.168.1.1-192.168.1.10 -j ACCEPT
# iptables -A INPUT -p udp --destination-port 11211 -m state --state NEW -m iprange --src-range 192.168.1.1-192.168.1.10 -j ACCEPT

Restart the iptables service to save changes

service iptables restart
OR
/etc/init.d/iptables restart

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

what I need to put there in Iptables ? should I need to insert there my vps’ ip address or local ipaddress ?

A

provide your own server IP address

Q

What are all the Hardware requirement to install Memcache?

A

system Must have a minimum 1GB RAM

Q

Where I can find Repository before installing memcached?

A

Use the following command wget http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-7.noarch.rpm rpm -Uvh epel-release-6-7.noarch.rpm

Q

Is this open source?

A

Yes it is an opensource.

Q

What is the Essential purpose of it is?

A

Memcached is memory object caching program. It is an open source program which helps to speed up the performance

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Elijah ?
Remote Desktop Connection Has Stopped Working

When accessing my remote machine server using remote desktop on a windows machine I am getting this error

forum (1)

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.