Redis安装

安装redis

软件下载地址

https://redis.io/download

解压软件

tar -zxvf redis-*.tar.gz (*代表版本号)

编译并安装

cd redis-*

使用make命令编译

make

编译完以后进入src文件夹下

cd src

运行make test测试是否可以安装

make test

如果出现下边提示,如果没有直接跳过下边操作

[root@localhost src]# make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1

TCL(Tool Command Language)工具脚本语言,是Linux内的一种语言包。,这里需要先安装tcl

1、先去这里下载:
http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
文件
2、然后将其拷贝至虚拟机
3、然后解压对于.tar.gz的后缀文件可以使用tar zxvf 。。。.tar.gz解压
tar zxvf tcl8.6.1-src.tar.gz
4、安装 Tcl
为编译 Tcl 做准备:
cd 到tcl文件夹里
[root@localhost Desktop]# cd tcl8.6.1/

cd unix
[root@localhost tcl8.6.1]# cd unix/

./configure
[root@localhost unix]# ./configure

编译软件包:
[root@localhost unix]# make

安装软件包:
[root@localhost unix]# make install


这个时候在命令行就可以输入tclsh进入tcl解释器
tcl就可以使用了。
继续我们的redis安装

再次测试make test,会进行检查。如果都是绿色的ok,就可以检查通过

安装

make PREFIX=/usr/local/redis install 

把解压的redis路径下的redis.conf的文件拷贝到安装路径下

[root@localhost Desktop]# cd redis-4.0.1/
[root@localhost redis-4.0.1]# ls
00-RELEASENOTES  INSTALL     runtest           tests
BUGS             Makefile    runtest-cluster   utils
CONTRIBUTING     MANIFESTO   runtest-sentinel
COPYING          README.md   sentinel.conf
deps             redis.conf  src
[root@localhost redis-4.0.1]# cp redis.conf /usr/local/redis
[root@localhost redis-4.0.1]# cd /usr/local/redis
[root@localhost redis]# ls
bin  redis.conf
到这里redis已经安装成功了。

修改redis.conf配置文件

把daemonize的值改为yes,默认为前端启动现在改为后台启动

启动redis

[root@localhost redis]# ./bin/redis-server ./redis.conf

 

 

参考链接:https://blog.csdn.net/qq_20989105/article/details/76390367

redis配置文件参考链接:https://www.cnblogs.com/Fooo/p/6599100.html

 

 

 

 

 

 

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值