ITKeyword - 技术文章推荐分享

首页 > memcache安装、配置、测试

memcache安装、配置、测试

标签: memcache,

相关推荐:Redis3.2的安装配置与JReid测试

环境 Centos7Redis版本 3.2.0安装目录 /usr/local/redis/redis-3.2.0Redis的介绍参见官网安装1 安装gcc与tcl# yum install gcc tcl2 下载3.2.0# mkdir /usr/local/redis# cd /usr/local/redis# wget http://downl

今天拿到一台干净的linux虚拟器,安装memcache,首先安装libevent库。wget https://github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gztar xvzf libevent-1.4.14b-stable.tar.gz./configuremakemake install 然后,编译、安装、配置Memcached,执行如下命令行:

wget http://www.memcached.org/files/memcached-1.4.20.tar.gztar xvzf memcached-1.4.20.tar.gzln -s /usr/local/memcached-1.4.20 /usr/local/memcached./configure --with-libevent=/usr/local/libevent/makemake install 安装过程中遇见这个问题:/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory 解决类似问题的步骤:1. 首先 find / -name libevent-1.4.so.2 找到缺少的链接文件到底在那儿。2. LD_DEBUG=libs /usr/local/bin/memcached -v3. 从Debug信息中就知道程序去哪里找链接库了。我这边程序去 trying file=/usr/lib/libevent-1.4.so.2 而我的链接库的实际存储位置是 /usr/local/lib/libevent-1.4.so.24. 做一个软连接 ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.25. 搞定。 最后启动memcache :

/usr/local/bin/memcached -d -m 2014 -I 20m -u root

-p 12800 -c 1024 -t20 写个小程序验证一下memecahe是否可以正常使用,输出都内容正确就OK

package com.testpai;import net.spy.memcached.AddrUtil;import net.spy.memcached.BinaryConnectionFactory;import net.spy.memcached.MemcachedClient;import net.spy.memcached.internal.OperationFuture;public class Tes

相关推荐:Memcache升级版:CouchBase的安装配置与使用说明

Memcache基本上已经是开发的标配了,但是对于Memcache集群,很多线上部署仍然是很单薄的。几个存在的问题:不健壮、数据不安全、配置变更可能导致存取异常、后备数据的一致性鉴于存在以上问题,Memcache的开发团队开发了Membase,支持多台服务器集群,数

tMemcached { public static void main(String[] args) throws Exception {

String address = "10.6.2.95:12800";

MemcachedClient client = new MemcachedClient(new BinaryConnectionFactory(),

AddrUtil.getAddresses(address));

String key = "magic_words";

int exp = 3600;

String o = "hello";

// set

OperationFuture<Boolean> setFuture = client.set(key, exp, o);

if(setFuture.get()) {

// get

System.out.println(client.get(key));

// append

client.replace(key, exp, " the world!");

System.out.println(client.get(key));

// prepend

client.prepend(exp, key, "Stone, ");

System.out.println(client.get(key));

// replace

o = "This is a test for spymemcached.";

OperationFuture<Boolean> replaceFuture = client.replace(key, exp, o);

if(replaceFuture.get()) {

System.out.println(client.get(key));

// delete

client.delete(key);

System.out.println(client.get(key));

}

}

client.shutdown();

}}

相关推荐:windows安装配置memcache和memcached

1:下载php_memcache-2.2.6-5.3-vc9-x86.zipmemcached-1.2.6-win32-bin.zip2: 解压配置a.memcache解压后得到 php_memcache.dll 和编译好的 memcached.exe打开你的php/ext,把 php_memcache.dll 复制进去,比如我的在F:/php/p

?????? 今天拿到一台干净的linux虚拟器,安装memcache,首先安装libevent库。wget https://github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gztar xvzf libevent-1.4....

------分隔线----------------------------