Redis学习(一)——环境搭建

来源:互联网 发布:mac ps教程 编辑:程序博客网 时间:2024/06/08 19:41

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.gzResolving download.redis.io (download.redis.io)... 109.74.203.151Connecting to download.redis.io (download.redis.io)|109.74.203.151|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 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.gzcd redis-3.2.6make

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 barOK127.0.0.1:6379> get foo"bar"127.0.0.1:6379> 
0 0