1)首先安裝最新版本的libevent安裝包 memcached
官網下載:http://libevent.org/ 測試
2)安裝最新版本的memchached安裝包 ui
官網下載:http://memcached.org/ scala
start () { rest
exit $RETVAL server
保存退出 ip
3)編寫一個測試memcached的小腳本 get
本人簡單的使用了一個perl鏈接memcached的模塊來作測試,腳本內容以下 it
# cat test_memcached.pl
#!/usr/bin/perl
use Cache::Memcached::Fast;
my $memd = new Cache::Memcached::Fast({
servers => [ { address => '192.168.123.44:10001', weight => 2.5 } ],
});
# Store scalars.
$memd->set(shen, 123, 10);
$memd->add(xiao, 456, 10);
$memd->set(ran, 789, 10);
# Print
print $memd->get(shen)."\n";
print $memd->get(xiao)."\n";
print $memd->get(ran)."\n";
$memd->flush_all;
保存退出 io