操作系统环境如下:
[root@zxl-nginx ~]# cat /etc/issue CentOS release 6.4 (Final) Kernel \r on an \m [root@zxl-nginx ~]# uname -r 2.6.32-358.el6.x86_64
下载redis软件包
[root@zxl-nginx ~]# wget http://download.redis.io/releases/redis-3.0.6.tar.gz
安装redis
root@zxl-nginx ~]# tar fxz redis-3.0.6.tar.gz [root@zxl-nginx ~]# cd redis-3.0.6 [root@zxl-nginx redis-3.0.6]# make [root@zxl-nginx redis-3.0.6]# make install [root@zxl-nginx redis-3.0.6]# cd .. [root@zxl-nginx ~]# mv redis-3.0.6 /usr/local/redis
客户端连接bin/redis-cli端口:6379停止exit 或quit 或 shutdown
启动redis
# /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf # netstat -ntpl|grep :6379 tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 4395/redis-server * tcp 0 0 :::6379 :::* LISTEN 4395/redis-server *
使用redis客户端redis-cli
root@zxl-nginx src]# redis-cli 127.0.0.1:6379> ping PONG 127.0.0.1:6379> set name abc OK 127.0.0.1:6379> get name "abc"
本文出自 “流鼻涕” 博客,请务必保留此出处http://noodle.blog.51cto.com/2925423/1726426
原文:http://noodle.blog.51cto.com/2925423/1726426