Onesystem and installation instructions
System: centos6.x_x64,memcached-1.5.3. Memcached official http://www.memcached.org/files/memcached-1.5.3.tar.gz. Libevent Library: https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
Second, start the installation
1> First Yum Install gcc
Yum install-y wget gcc
2> Installing the Source libevent Library
#wget #tar zxvf libevent-2.0.21-stable.tar.gz#./configure--prefix=/usr/local/libevent#make && make install
3> Download Install memcached
#wget #tar-zxvf memcached-1.5.3.tar.gz#./configure--prefix=/usr/local/memcached--with-libevent=/usr/local/ Libevent#make && make Install#ln-s/usr/local/memcached/bin/memcached/usr/local/bin #建立软连接
Third, edit the script to join the startup item
1> Script
#!/bin/sh## memcached: memcached daemon## chkconfig: - 90 25# description: MemCached Daemon# Source function library.# author: pkey san 2015/12/07. /etc/rc.d/init.d/functions. /etc/ Sysconfig/networkprog=memcachedpidfile=${pidfile-/var/run/memcached.pid}start () { echo -n $ "starting memcached: " daemon --pidfile=${pidfile} /usr/local/bin/memcached -u daemon -d -m 512 -l 127.0.0.1 -c 4096 -p 11211 echo ' ps aux |grep memcached |grep 11211 |grep -v grep |awk ' {print $2} ' > $pidfile echo} Stop () { echo -n $ "shutting down memcached: " killproc $prog echo}rh_status () { status -p ${pidfile} $prog}[ -f /usr/local/bin/memcached ] | | exit 0# See how we were called.case "$" in start) start ;; stop) stop ;; status) rh_status ;; restart|reload) stop start ;; *) echo $ "usage: $0 {start|stop|status|restart|reload|}" exit 1esacexit 0
2> Explanatory Notes
Daemon--pidfile=${pidfile}/usr/local/bin/memcached-u daemon-d-M 512-l 127.0.0.1-c 4096-p 11211
-M: Specify Memcache Cache memory size
-L: Specifies the listening address of the Memcache general intranet
-C: Maximum number of concurrent connections.
-P: Listening port
3> Add boot up
#chmod +x/etc/init.d/memcached#chkconfig--add memcached#chkconfig memcached on#service memcached start|stop|restart| Reload|status
centos6.x installation memcached-1.5.x