---
title: "Redis第一步"
author: "pluto418"
date: "2012-03-25T09:46:58Z"
tags: []
categories: ["企业架构"]
slug: "redis"
draft: false
lastmod: "2014-05-26T19:29:48Z"
id: 1463318
url: "https://pluto418.iteye.com/blog/1463318"
---

1） 下载： http://redis.io/ OR http://www.redis.cn/download.html

       最新稳定版： 2.4.9

 

2） 安装：

      #tar zxvf redis-2.4.9.tar.gz  
      #cd redis-2.4.9  
      #make

 

3） 修改配置

     
     #vi /etc/redis.conf  
    取消注释 requirepass foobared

 

4） 启动Redis

      #redis-server src/redis.conf 

 

     关闭Redis

     #src/redis-cli shutdown

 

5）常用命令

     查看进程 #ps -ef | grep redis

 

     进入命令界面

     cmd telnet 127.0.0.1 6379 OR  #scc/redis-cli

 

     redis&gt;set a b (error) ERR operation not permitted  (-a 设置这个时候没起作用 )  
     授权 redis&gt;auth foobared

     Set值      #redis&gt;set a b

     Get值     #redis&gt;get a

 

     存在       #redis&gt;exists a

 

     退出        #redis&gt;quit

 

    Redis 常用命令参考：http://redis.readthedocs.org/en/latest/