CentOS安装Redis

    xiaoxiao2021-08-25  89

    使用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后台运行成功

    转载请注明原文地址: https://ju.6miu.com/read-677066.html

    最新回复(0)