代码改变世界

Linux 安装 Redis

2017-05-30 11:46  DataBases  阅读(217)  评论(0编辑  收藏  举报

[root@localhost ~]# wget http://download.redis.io/releases/redis-2.8.3.tar.gz
[root@localhost ~]# tar zxvf redis-2.8.3.tar.gz
[root@localhost ~]# cd redis-2.8.3
[root@localhost redis-2.8.3]# make
[root@localhost redis-2.8.3]# mkdir  /usr/redis
[root@localhost redis-2.8.3]# cd src/
[root@localhost src]# cp redis-server /usr/redis/
[root@localhost src]# cp redis-benchmark /usr/redis/
[root@localhost src]# cp redis-cli /usr/redis/
[root@localhost src]# cd ..
[root@localhost redis-2.8.3]# cp redis.conf /usr/redis/
[root@localhost redis-2.8.3]# cd /usr/redis/
[root@localhost redis]# ./redis-server redis.conf
[4444] 30 May 04:16:20.667 * Max number of open files set to 10032
                _._                                                 
           _.-``__ ''-._                                            
      _.-``    `.  `_.  ''-._           Redis 2.8.3 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in stand alone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 4444
  `-._    `-._  `-./  _.-'    _.-'                                  
 |`-._`-._    `-.__.-'    _.-'_.-'|                                 
 |    `-._`-._        _.-'_.-'    |           http://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                  
 |`-._`-._    `-.__.-'    _.-'_.-'|                                 
 |    `-._`-._        _.-'_.-'    |                                 
  `-._    `-._`-.__.-'_.-'    _.-'                                  
      `-._    `-.__.-'    _.-'                                      
          `-._        _.-'                                          
              `-.__.-'                                              

[4444] 30 May 04:16:20.863 # Server started, Redis version 2.8.3
[4444] 30 May 04:16:20.890 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
[4444] 30 May 04:16:20.890 * The server is now ready to accept connections on port 6379
[root@localhost redis]# ./redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"
127.0.0.1:6379>