Redis起步

操作系统:windows 7/xp
语言环境:java
步骤:
1. 下载jedis,redis(win32/64) ;
2. 将jedis-2.x.x.jar加入classpath;
3. 启动redis-server;
4. 运行测试代码:
// 连接 jedis
String host = "127.0.0.1";
int port = 6379, timeout = 300;
Jedis jedis = new Jedis(host, port, timeout);
// 存
jedis.set("oschina", "开源中国");
// 取
String v = jedis.get("oschina");
System.out.println(v);

资源列表:
redis中文官方网站: http://redis.cn/
redis中文版命令参考: http://redis.readthedocs.org/en/latest/index.html
redis (Win32/64 Dušan Majkić.): https://github.com/dmajkic/redis/downloads
redis (Win32/64 Microsoft分支): https://github.com/microsoft-interop/redis
jedis 源码:  https://github.com/xetorthio/jedis
jedis jar: https://github.com/xetorthio/jedis/downloads

其它:
(1) Redis 本身不直接支持 win32/win64,且不建议在生产环境下使用win32/win64版本.
(2) Microsoft的Redis版本需要使用Visual Studio 2010 编译(可以使用Microsoft Visual Studio 2010 Express),编译的步骤在上面的网页上有详细说明,亲测可行.
(3) jedis的api 可以参考reids命令手册,或者下载源码生成java doc.
(4) 如果使用String.getBytes()作为key,那么尽量不要混合使用String做key,否则请注意字符编码问题.

你可能感兴趣的:(redis,jedis)