$ tar xzvf redis-3.0.3.tar.gz
$ cd redis-3.0.3
$ make
编译完成进行 $ make test 命令测试
得到如下错误信息:
cd src && make test
make[1]: Entering directory `/tmp/redis-3.0.1/src'
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory `/tmp/redis-3.0.1/src'
make: *** [test] Error 2
Redis在make test有使用到tclsh对Redis进行测试,所以需要将tclsh安装好。
下载地址:http://www.tcl.tk/software/tcltk/download.html
$ tar xzvf tcl8.6.4-src.tar.gz
$ cd tcl8.6.4/unix
//进行环境变量配置
$
/
$make
$make install
安装完成之后需要将tclsh添加到PATH中,并使其生效
# vim /etc/profile
PATH=/home/zhouwei/tools/tcl8.6.4/bin:$PATH
source
再次测试
$ make test
6、设置配置文件路径
mkdir -p /etc/redis
7、修改配置文件
vi /etc/redis/redis.conf
仅修改: daemonize yes
//默认情况下,redis不是在后台运行的,如果需要在后台运行,把该项的值更改为yes。
8、启动
redis-server /etc/redis/redis.conf
9、查看启动
ps -ef | grep redis
10、使用客户端
redis-cli
OK
127.0.0.1:6379> get name
"test"
>set name 菩提小师傅的博客
OK
127.0.0.1:6379> get name
"\xc6\xd0\xcc\xe1\xd0\xa1\xca\xa6\xb8\xb5\xb5\xc4\xb2\xa9\xbf\xcd"