redis安装

2 篇文章 0 订阅

redis安装


安装

$ wget http://download.redis.io/releases/redis-3.0.0.tar.gz
$ tar xzf redis-3.0.0.tar.gz
$ cd redis-3.0.0
$ make
$vim redis.conf

修改端口

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379

添加密码

# use a very strong password otherwise it will be very easy to break.
requirepass your_password

二进制文件编译完成后在src目录下. 运行如下:

$ src/redis-server

使用Redis内建的客户端以交互的方式使用:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

编译失败,如更改错误后继续编译仍不通过,可清理一下环境。
make clean清除之前编译的可执行文件及配置文件。
make distclean要清除所有生成的文件。

问题总结如下:

$ make
-bash: make: command not found

yum -y install make
$ make
/bin/sh: cc: command not found

yum -y install gcc
$ make test
You need tcl 8.5 or newer in order to run the Redis test

 yum -y install tcl
   CC adlist.o
在包含自 adlist.c:34 的文件中:
zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录
zmalloc.h:55:2: 错误:#error "Newer version of jemalloc required"
make[1]: *** [adlist.o] 错误 1
make[1]: Leaving directory `/home/redis/redis-2.8.19/src'
make: *** [all] 错误 2


$ make distclean
Hint: It's a good idea to run 'make test' ;)

make[1]: 警告:检测到时钟错误。您的创建可能是不完整的。
make[1]: Leaving directory `/home/redis/redis-2.8.19/src'
make: 警告:检测到时钟错误。您的创建可能是不完整的。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值