centos6.x installation memcached-1.5.x

Source: Internet
Author: User
Tags memcached

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.