NoSQL篇 | Memcached 安装配置
Posted 5ithink
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NoSQL篇 | Memcached 安装配置相关的知识,希望对你有一定的参考价值。
概览
简介
安装配置
Q&A
参考连接
About Memcached
Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.
安装配置
1.安装libevent
a.下载:libevent-2.1.8-stable.tar.gz
cd /home/memcached
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar xvf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
b.配置
./configure --prefix= /home/memcached/libevent-2.1.8
c.编译&安装
make && make install
d.验证安装
l l /home/memcached/libevent-2.1.8 查看以下文件是否存在
libevent-2.1.so.*
libevent.a
libevent.la
libevent.so
2.安装:memcached
a.下载:memcached-1.5.7.tar.gz
wget http://memcached.org/files/memcached-1.5.7.tar.gz
tar xvf memcached-1.5.7.tar.gz
cd memcached-1.5.7
b.配置
./configure --with-libevent=/home/memcached/libevent-2.1.8 --prefix=/opt/webs/app/memcached-1.5.7
c.编译&安装
make && makeinstall
3.运行
a.启动
cd /home/memcached/memcached-1.5.7/bin
./memcached -d -m 2048 -l 192.168.1.202 -u root -p 11211 -c 1024
tips:
-d选项是启动一个守护进程
-m是分配给Memcache使用的内存数量,单位是MB
-u是运行Memcache的用户
-p是设置Memcache监听的端口, 1024以上的端口
-c选项是最大运行的并发连接数,默认是1024
-P是设置保存Memcache的pid文件
b.连接:telnet 192.168.1.202 11211
c.查看状态:stats
e.set命令
set aaa 0 0 5
f.get命令
get aaa
g.退出telnet连接
quit
Q&A
参考链接
http://memcached.org/
以上是关于NoSQL篇 | Memcached 安装配置的主要内容,如果未能解决你的问题,请参考以下文章