zoukankan      html  css  js  c++  java
  • Memcached安装配置

    1、安装依赖包libevent
    yum -y install libevent
    •2、编译安装
    tar xvf memcached-1.2.0.tar.gz
    cd memcached-1.2.0
    ./configure --prefix=/usr/local/memcached
    make
    make install
    参数
    •p 监听的端口
    •-c 最大同时连接数,默认是1024
    •-m 最大内存使用,单位MB。默认64MB
    •-P 设置保存Memcache的pid文件
    •-d 后台运行
    •-u 运行Memcache的用户,仅在以root运行的时候有效
    启动脚本:
    •#!/bin/bash
    •pid=`ps -ef|grep memcached|grep -v "grep"|awk '{print $2}'`
    •if [[ $pid ]]
    •then
    •echo "memcached is running..."else/usr/local/bin/memcached -d -m 10 -p 11211 -u root -c 256 -P /tmp/memcached.pid >> /tmp/memcached.log
    •echo 'memcached started pidfile path is /tmp/memcached.pid'
    •fi
    停止脚本:
    •#!/bin/bash
    •pid=`cat /tmp/memcached.pid`
    •new_pid=`ps -ef|grep $pid|grep -v "grep"|awk '{print $2}'`
    •if [[ $new_pid ]]
    •then
    •kill -9 `cat /tmp/memcached.pid`
    •echo "memcached stoped..."else
    •echo "memcached is not runing...."
    •fi
  • 相关阅读:
    Keil的使用-1创建项目和工程
    UICollectionView进阶练习
    UICollectionView基础API笔记
    UICollectionView笔记2
    UICollectionView笔记1
    OC与JS交互之WKWebView
    OC与JS交互之JavaScriptCore
    OC与JS交互之UIWebView
    OC与JS交互前言
    最牛B的编码套路
  • 原文地址:https://www.cnblogs.com/lingxia/p/6292097.html
Copyright © 2011-2022 走看看