查看安装环境:
[root@R430-3-13 ~]# cat /proc/version
Linux version 2.6.32-573.22.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016
[root@R430-3-13 ~]# cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m
1、下载、解压、编译
下载:
[root@R430-3-13 ~]# cd /usr/local/
[root@R430-3-13 local]# wget http://download.redis.io/releases/redis-3.0.7.tar.gz
--2016-03-29 18:58:36-- http://download.redis.io/releases/redis-3.0.7.tar.gz
正在解析主机 download.redis.io... 109.74.203.151
正在连接 download.redis.io|109.74.203.151|:80...
解压:
[root@R430-3-13 ~]# tar xzf redis-3.0.7.tar.gz
编译:
[root@R430-3-13 redis-3.0.7]# cd redis-3.0.7
[root@R430-3-13 redis-3.0.7]# make
2、编译好的二进制文件(即我们的redis程序)在redis-3.0.7文件夹下的src目录下
启动服务:
[root@R430-3-13 ~]# cd src
[root@R430-3-13 src]# ./redis-server
出现如上界面,说明服务启动成功。
3、测试
始用客户端连接:
[root@R430-3-13 src]# ./redis-cli
127.0.0.1:6379> keys *
(empty list or set)
添加、获取数据:
127.0.0.1:6379> set username slov7ch
OK
127.0.0.1:6379> get username
"slov7ch"
127.0.0.1:6379>
原文:http://www.cnblogs.com/imzk/p/5334175.html