ubuntu18.04 安装Redis

1:下载redis源码

wget http://download.redis.io/redis-stable.tar.gz

2:解压 

tar xvzf redis-stable.tar.gz

3:进入redis-stable目录

cd redis-stable

4:build源码

make

5:测试一下build是否成功了

make test

如果看到如下输出

\o/ All tests passed without errors!

Cleanup: may take some time... OK
make[1]: Leaving directory '/home/ghc/Documents/nano/redis-stable/src'

证明成功了

6:去到src目录就可以看到

  • redis-server is the Redis Server itself.
  • redis-sentinel is the Redis Sentinel executable (monitoring and failover).
  • redis-cli is the command line interface utility to talk with Redis.
  • redis-benchmark is used to check Redis performances.
  • redis-check-aof and redis-check-dump are useful in the rare event of corrupted data files.

7:启动Redis server

redis-server

默认端口是6379

8:查看server是否正在运行

redis-cli ping

返回pong就证明可以ping通 是正在运行

 

遇到的错:

1:执行make test之后报错

 cd src && make test
make[1]: Entering directory '/home/ghc/Documents/nano/redis-stable/src'
CC Makefile.dep
You need tcl 8.5 or newer in order to run the Redis test
Makefile:242: recipe for target 'test' failed
make[1]: *** [test] Error 1
make[1]: Leaving directory '/home/ghc/Documents/nano/redis-stable/src'
Makefile:6: recipe for target 'test' failed
make: *** [test] Error 2

 

这表明没有安装tcl,执行 sudo apt install tcl来安装

 

参考:https://redis.io/topics/quickstart

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值