Install Memcached in CentOS 6.6
1. Environment Introduction
1) CentOS 6.6
2) memcached-1.4.24
Ii. Deployment and Installation
Specific deployment steps:
Step 1: Install
Step 2: Configure
Step 3: Run
Step 4: Check
Start now:
1) Installation
$ Yum install-y wget gcc
$ Wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
$ Tar zxvf libevent-2.0.21-stable.tar.gz
$ Libevent-2.0.21-stable cd
$./Configure -- prefix =/usr/local/libevent
$ Make & make install
$ Wget http://www.memcached.org/files/memcached-1.4.24.tar.gz
$ Tar zxvf memcached-1.4.24.tar.gz
$ Memcached-1.4.24 cd
$./Configure -- prefix =/usr/local/memcached -- with-libevent =/usr/local/libevent
$ Make & make install
$ Ln-s/usr/local/memcached/bin/memcached/usr/local/bin/
2) Configuration
$ Touch/etc/init. d/memcached
$ Chmod 755/etc/init. d/memcached
$ Vi/etc/init. d/memcached
#! /Bin/sh
#
# Memcached: MemCached Daemon
#
# Chkconfig:-90 25
# Description: MemCached Daemon
#
# Source function library.
./Etc/rc. d/init. d/functions
./Etc/sysconfig/network
Start ()
{
Echo-n $ "Starting memcached :"
Daemon/usr/local/bin/memcached-u daemon-d-m 2048-l 0.0.0.0-c 4096-p 11211
Echo
}
Stop ()
{
Echo-n $ "Shutting down memcached :"
Killproc memcached
Echo
}
[-F/usr/local/bin/memcached] | exit 0
# See how we were called.
Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Restart | reload)
Stop
Start
;;
Condrestart)
Stop
Start
;;
*)
Echo $ "Usage: $0 {start | stop | restart | reload | condrestart }"
Exit 1
Esac
Exit 0
3) Run
$/Etc/init. d/memcached start
$ Chkconfig memcached on
4) Check
# Check processes and ports
$ Ps aux | grep memcached
$ Netstat-ntlp | grep memcached
$ Echo "stats settings" | nc 127.0.0.1 11211
Memcached installation and startup script
Performance problems of using Memcached in PHP
Install Memcached in Ubuntu and its command explanation
Install and apply Memcached
Use Nginx + Memcached's small image storage solution
Getting started with Memcached
For details about Memcached, click here
Memcached: click here
This article permanently updates the link address: