zoukankan      html  css  js  c++  java
  • Centos6.6 安装Memcached

    一.环境介绍

     

    1)Centos6.4

    2) memcached-1.4.24

     

    二.部署安装

    计划具体部署步骤:

    步骤1:安装

    步骤2:配置

    步骤3:运行

    步骤4:检查

     

    现在开始:

    1)安装

    $ 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
    
    $ cd libevent-2.0.21-stable
    
    $ ./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
    
    $ cd memcached-1.4.24
    
    $ ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent
    
    $ make && make install
    
     
    
    $ ln -s /usr/local/memcached/bin/memcached /usr/local/bin/

     

     

    2)配置

    $ 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)运行

    $ /etc/init.d/memcached start
    
    $ chkconfig memcached on

     

    4)检查

     

    #主要是检查进程以及端口

    $ ps aux|grep memcached
    
    $ netstat -ntlp|grep memcached
    
    $ echo "stats settings" | nc 127.0.0.1 11211

  • 相关阅读:
    字典树入门
    Cyclic Nacklace HDU 3746 KMP 循环节
    KMP字符串匹配 模板 洛谷 P3375
    Phone List POJ-3630 字典树 or 暴力
    stringstream istringstream ostringstream 三者的区别
    单词数 HDU 2072 字符串输入控制
    逆序单词 HIhoCoder 1366 字典树
    input框中修改placeholder的样式
    如何使用$.each()与$().each()以及他们的区别
    css解决input的阴影
  • 原文地址:https://www.cnblogs.com/caoguo/p/4625533.html
Copyright © 2011-2022 走看看