---
title: "redis "
author: "ileson"
date: "2014-09-14T18:08:05Z"
tags: []
categories: ["开源软件"]
slug: "redis"
draft: false
lastmod: "2015-04-05T09:28:48Z"
id: 2116319
url: "https://ileson.iteye.com/blog/2116319"
---

[Redis官方网址](http://www.redis.io/)
[Redis中文网](http://www.redis.cn/)
 
1、linux 安装redis 服务.（[下载最新稳定版](http://www.redis.cn/download.html)）
   下载、解压、安装，下载页面，有例子。

   配置成linux 开机自启：
       修改redis.conf 文件中的相关行；
       
```shell
vim /usr/local/redis-2.8.13/redis.conf
```


#以守护进程方式运行
#daemonize no改为 <span style="color:red">daemonize yes</span>  

#修改dir ./为绝对路径, 
./ redis  #改为/usr/local/
![](http://dl2.iteye.com/upload/attachment/0101/5380/1202de38-76d5-31e2-a718-0326cfea096a.png)


#修改appendonly为yes  

#指定是否在每次更新操作后进行日志记录， 
appendonly no  改为 <span style="color:red">appendonly yes</span>



       将程序弄成linux 开机自启，其实就是在/etc/rc.local 文件中加相应命令行。可以用 

```shell
echo "/usr/local/redis-2.8.13/src/redis-server /usr/local/redis-2.8.13/redis.conf" >> /etc/rc.local
```
 这句执行的结果是:
![](http://dl2.iteye.com/upload/attachment/0101/5340/4a898d86-fe8a-3250-a367-1a1066b59e8d.png)

       




2、windows 安装使用
   [windows 平台](https://github.com/MSOpenTech/redis)下的[安装包版本列表](https://github.com/MSOpenTech/redis/releases)

 [windows 下的安装及使用教程](http://blog.csdn.net/renfufei/article/details/38474435)

jar 包问题

3、[redis作为tomcat默认的session存储器](http://www.tuicool.com/articles/EFnaUz)

   使用过程中[jar 包问题](http://www.oschina.net/question/815618_194320?sort=time)

   环境是: win7 64bit + jdk1.7 +  tomcat7 + redis2.8.17 + nginx1.6.2
   JAR 包：jedis-2.2.1.jar + commons-pool-1.6.jar + tomcat-redis-session-manager-1.2-tomcat-7.jar   
   tomcat 终于可以启动了，但换个版本 jedis-2.6.2.jar + commons-pool2-2.3.jar 就启动不了。