CentOS安装Redis

使用wget  在Redis官网上下载  redis

http://download.redis.io/releases/redis-3.2.5.tar.gz

解压 tar -zxvf redis-3.2.5.tar.gz

使用make  

出现错误 make[1]: Entering directory `/root/Downloads/redis-3.2.5/src'     CC adlist.o /bin/sh: cc: command n

解决方案  需要安装gcc   redis中含有c文件            yum install gcc

make成功之后  运行make test


出现错误    You need tcl 8.5 or newer in order to run the Redis test

解决方案  安装tcl       yum install tcl


再次调用make test

出现错误   Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/integration/replication-psync.tcl

解决方案  vi tests/integration/replication-psync.tcl

找到 test "Test replication partial resync: $descr (diskless: $diskless, reconnect: $reconnect)" {
                # Now while the clients are writing data, break the maste-slave
                # link multiple times.
                if ($reconnect) {
                    for {set j 0} {$j < $duration*10} {incr j} {
                        after 100
按下 i   转换为insert模式 

将 100 改为500  按下esc  输入 :wq     退出

重新运行 make test

得到结果 All tests passed without errors!  make test 成功   

cd src  目录下

make install

redis安装完成 开始配置  在src下找到    绿色的可执行文件

mkreleasehdr.sh 

redis-benchmark 

redis-check-aof 

 redis-check-rdb

 redis-cli 

redis-sentinel 

redis-server 

redis-trib.rb 


单独提取出来 可以mkdir一个新的文件夹   执行 ./redis-server    

redis成功运行  但只能在该界面运行 Ctrl+C推出当前会话    redis关闭


修改配置  将redis.conf 中的 daemonize 修改为yes

以配置文件形式启动redis    ./redis-server  ../redis.conf   

使用 ps -ef | grep redis  查看  

redis后台运行成功



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值