Windows系统部署reids:
1.下载解压包[https://github.com/MSOpenTech/redis/releases] (我下的是最新安装包Redis-x64-3.2.100.zip);
2. 解压后,进入DOC操作系统窗口,进入解压文件的目录下,执行命令【redis-server.exe redis.windows.conf】,即启动了。
3. 可以自定义启动脚本,新建start.bat文件,文件内容为命令【redis-server.exe redis.windows.conf;打开redis.windows.conf文件,搜索6379找到端口,可修改端口(6379为默认端口)。
JAVA中应用:
我的环境是SpringMVC+Maven+redis整合
1. 增加pox.xml内容
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.x.redis</groupId>
<artifactId>Spring_redis</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Spring_redis</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.6.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
</project>
如果不能在线联网,直接下载两个jar包,commons-pool-1.5.4.jar和jedis-2.1.0.jar;
2. 在spring的配置文件里加入关于redis的切面配置,以便在指定的类指定的方法环绕执行缓冲取值。
待更新哦。。、