Memcached安装(CentOS 7)

Memcached安装(CentOS 7)缓存

参考:http://memcached.org/downloads memcached

1、安装所需软件包google

 yum install libevent.x86_64
 yum install libevent-devel.x86_64

2、安装memcachedspa

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 && make && sudo make install

3、启动memcachedcode

/usr/local/bin/memcached -d -m 1024 -u root -l 192.168.80.12 -p 11211 -L -P /tmp/memcached.pid

    参数参考:https://code.google.com/p/memcached/wiki/NewConfiguringServer#Commandline_Argumentsorm

-m 告诉memcached最多使用多少内存来存放缓存数据(单位M).
xml

-d  告诉memcached后台运行ip

-u 运行memcached的用户内存

-l 是memcached监听的ipget

-p 是memcached监听的端口,默认端口是11211

-P 是设置memcache的pid文件

-L 尝试使用大内存页(若是可用的话)。提升内存页尺寸能够减小"页表缓冲(TLB)"丢失次数,提升运行效率


4、使用telnet链接memcached

# telnet localhost 11211

#stats (打印memcached统计信息)

5、设置为开机启动

 echo "/usr/local/bin/memcached -d -m 1024 -u root -l 192.168.80.12 -p 11211 -L -P /tmp/memcached.pid">>/etc/rc.local

6、中止 memcached

     kill `cat /tmp/memcached.pid`

相关文章
相关标签/搜索