Redis学习之路(一):环境搭建

Ubuntu 安装Redis

1.下载

wget http://download.redis.io/releases/redis-3.2.6.tar.gz
--2016-12-16 23:51:39--  http://download.redis.io/releases/redis-3.2.6.tar.gz
Resolving download.redis.io (download.redis.io)... 109.74.203.151
Connecting to download.redis.io (download.redis.io)|109.74.203.151|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1544806 (1.5M) [application/x-gzip]
Saving to: ‘redis-3.2.6.tar.gz’

redis-3.2.6.tar.gz                 100%[===============================================================>]   1.47M  32.1KB/s    in 60s     


2.解压、make

tar xzf redis-3.2.6.tar.gz
cd redis-3.2.6
make

3.启动服务

 cd src
 ./redis-server
6845:M 16 Dec 23:56:05.526 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 6845
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                    

4.启动命令行测试

cd redis-3.2.6/
cd src
./redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"
127.0.0.1:6379> 

你可能感兴趣的:(Redis学习之路(一):环境搭建)