您的位置:首页 > 数据库 > Redis

redis-3.0.3安装测试

2015-08-17 14:05 621 查看
$ 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 版本选择:tcl8.6.4-src.tar.gz

$ tar xzvf tcl8.6.4-src.tar.gz

$ cd tcl8.6.4/unix

//进行环境变量配置

$ ./configure --prefix=/home/zhouwei/tools/tcl8.6.4 --enable-64bit

/

$make //编译

$make install //安装

安装完成之后需要将tclsh添加到PATH中,并使其生效

# vim /etc/profile

PATH=/home/zhouwei/tools/tcl8.6.4/bin:$PATH //可以在最前面的注释后面添加

source /etc/profile

再次测试

$ make test 通过 ok

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

127.0.0.1:6379> set name test

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"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: