Windows系统部署redis及java中应用

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.0modelVersion>

  <groupId>com.x.redisgroupId>
  <artifactId>Spring_redisartifactId>
  <version>1.0-SNAPSHOTversion>
  <packaging>jarpackaging>

  <name>Spring_redisname>
  <url>http://maven.apache.orgurl>

  <properties>
    <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
  properties>

  <dependencies>
     <dependency>  
            <groupId>org.springframework.datagroupId>  
        <artifactId>spring-data-redisartifactId>  
        <version>1.6.0.RELEASEversion>   
    dependency>  
    <dependency>  
        <groupId>org.springframeworkgroupId>  
        <artifactId>spring-coreartifactId>  
        <version>3.1.2.RELEASEversion>  
    dependency>        
    <dependency>  
        <groupId>redis.clientsgroupId>  
        <artifactId>jedisartifactId>  
        <version>2.1.0version>  
    dependency>               
  dependencies>
project>

如果不能在线联网,直接下载两个jar包,commons-pool-1.5.4.jar和jedis-2.1.0.jar;
2. 在spring的配置文件里加入关于redis的切面配置,以便在指定的类指定的方法环绕执行缓冲取值。

待更新哦。。、

你可能感兴趣的:(redis缓冲,redis,java)