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.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的切面配置,以便在指定的类指定的方法环绕执行缓冲取值。

待更新哦。。、

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值