01.redis安装

redis安装##

安装

  • 1、到官网下载最新stable版
  • 2、解压源码并进入目录(tar -xzvf redis.tar.gz)
  • 3、切换到解压目录(cd redis),执行(make)
  • 4、执行测试(可选 make test)
  • 5、安装到指定目录,如 /usr/local/redis(make PREFIX=/usr/local/redis install)

安装常见错误

执行make错误

Q: cc: command not found
A:yum -y install gcc gcc-c++ libstdc++-devel

Q: cd src && make all
make[1]: Entering directory "/software/redis-2.8.8/src"
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory "/software/redis-2.8.8/src"
make: *** [all] Error 2
A:make MALLOC=libc (不知道为什么这么用?)

执行make test错误

Q:You need tcl 8.5
A.yum install tcl

启动运行

拷贝源码目录下的redis.conf文件到/usr/local/redis(安装目录)
进入安装redis目录执行./bin/redis-server redis.conf
(默认前端运行模式。后台进程模式: 修改conf daemonize yes)
客户端连接测试./bin/redis-cli

posted @ 2016-03-11 18:16  永远改不完的bug  阅读(197)  评论(0编辑  收藏  举报