Memcached Install - windows and linux
来源:互联网 发布:淘宝上怎么投诉快递 编辑:程序博客网 时间:2024/05/23 01:19
Outline
- Outline
- Install/Command
- Linux
- install
- Commands
- Windows
- Linux
- Client Usage/API
- Java - spymemcached
- Resources
Install/Command
Linux
Billing Team Manual
memcached FAQ
install
install libevent
libevent Download
libevent-1.4.12.tar.gz 2009-07-24
$ tar -zxvf libevent-1.x.x.tar.gz
$ ./configure --prefix=/usr/
$ make
$ make test
$ make install
install memcached
memcached Download
memcached-1.4.0.tar.gz - July 9th, 2009
$ tar -zxvf memcached-1.x.x.tar.gz
$ ./configure --prefix=/usr/local/memcached --with-libevent=/usr/ --enable-threads (you probably want threads)
$ make
$ make test
$ sudo make install
Commands
Start/Stop
text protocol
//startcd /usr/local/memcached/bin./memcached -d -m 100 -u root -p 11211 -c 256 -P /tmp/memcached.pid -m memory allocated for memcached server, unit is MB -u the user run memcached. -l listen host ip address. -p listen port number. -c concurrent thread number. -P the file saving memcached pid.//monitortelnet 172.16.100.117 11211//shutdownkill `cat /tmp/memcached.pid`
Storage
$ set key001 0 0 5
$ hello
$ STORED
$ get key001
$ VALUE key001 0 5
$ hello
$ END
$ delete key001
$ DELETED
$ get key001
$ END
$ set key001 0 0 5
$ hello
$ STORED
$ flush_all
$ OK
$ get key001
$ END
- set <key> <flags> <exptime> <bytes>
- flush_all : Its effect is to invalidate all existing items immediately (by default) or after the expiration specified.
Windows
memcached-win32
- Download : version: 1.2.1 - Dec 23, 2006
- unzip : Unzip the binaries in your desired directory (eg. c:/memcached)
- setup : c:/memcached/memcached.exe -d install
- start : c:/memcached/memcached.exe -d start
Client Usage/API
clients
Java - spymemcached
spymemcached
spymemcached javadoc
//connectMemcachedClient c=new MemcachedClient( new InetSocketAddress("hostname", portNum));// Store a value (async) for one hourc.set("someKey", 3600, someObject);// Retrieve a value (synchronously).Object myObject=c.get("someKey");// Try to get a value, for up to 5 seconds, and cancel if it doesn't returnObject myObj=null;Future<Object> f=c.asyncGet("someKey");try { myObj=f.get(5, TimeUnit.SECONDS);} catch(TimeoutException e) { // Since we don't need this, go ahead and cancel the operation. This // is not strictly necessary, but it'll save some work on the server. f.cancel(false); // Do other timeout related stuff}
Resources
Inside into memcached, Chinese
- Memcached Install - windows and linux
- Install memcached and memcache for PHP on windows
- linux install memcached
- memcached install and brief intro
- linux install memcached,Linux安装memcached
- Memcached install and config for fedora
- linux move and install
- install linux and win10
- Memcached Install
- Memcached install
- Linux QT install and configration
- [Linux]Install And Configure Trac
- Install Android Composite ADB Interface driver for Windows 7 and Ubuntu Linux
- How to install and run Microsoft Windows for free on Linux
- boost linux & windows plostform Install
- Windows/linux powershell 安装install
- install subversion and trac under windows
- Install ITK and VTK on Windows
- Php比较字符串相似度函数的利用,joomla datafeed
- 双向链表 001
- Lex的编程
- Android bluetooth development
- MySQL的EMS--中文显示问题
- Memcached Install - windows and linux
- Silverlight的问题
- 使用Synchronized块同步方法
- C/C++头文件的作用
- SCDN上好多maomao啊
- csdn的博客上传word图片
- ipod
- 学习网页集合
- Android JNI详述