CentOS-6.4 installation memcached

Source: Internet
Author: User
Tags memcached stop script

1. Prepare documents
Cd/usr/src

Latest Version: Http://code.google.com/p/memcached/downloads/list

wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz

2, Installation Libevent
CD/USR/SRCTAR-ZXVF LIBEVENT-2.0.20-STABLE.TAR.GZCD libevent-2.0.20-stable is configured with the./configure command to check the current environment./configure- Prefix=/usrmakemake Install
3, installation memcached
CD/USR/SRCTAR-ZXVF memcached-1.4.15.tar.gzcd Memcached-1.4.15./configuremakemake Install
4. Verify the installation
Ll/usr/local/bin | grep memcached
5. Start memcached
Ln-s/usr/lib/libevent-2.0.so.5/lib64/libevent-2.0.so.5/usr/local/bin/memcached-d-M 512-c 512-p 11211-u root-t 10

6.memcached start Stop script

Vi/etc/rc.d/init.d/memcached

The contents are as follows:

#!/bin/sh

#
# memcached:memcached Daemon
#
# Chkconfig:-90 25
# description:memcached Daemon
#
# Source function library.
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
#[${networking} = "No"] && exit 0
#[-r/etc/sysconfig/dund] | | Exit 0
#. /etc/sysconfig/dund
#[-Z "$DUNDARGS"] && exit 0
Start ()
{
Echo-n $ "Starting memcached:"


Daemon $MEMCACHED-u daemon-d-M 1024-u nobody-p 11211


Echo
}
Stop ()
{
Echo-n $ "Shutting down memcached:"
Killproc memcached
Echo
}

Memcached= "/usr/local/bin/memcached"

[-F $MEMCACHED] | | Exit 1
# See how we were called.
Case "$" in
Start
Start
;;
Stop
Stop
;;
Restart
Stop
Sleep 3
Start
;;
*)
echo $ "Usage: $ {Start|stop|restart}"
Exit 1
Esac
Exit 0

Then execute the following command:

CD  /etc/rc.d/init.dchmod 777 memcachedchkconfig  --add memcached chkconfig  --level 235  memcached  onchkconfig  --list | grep mem

CentOS-6.4 installation memcached

Related Article

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.