centos8安裝redis


1.下載tar包

wget http://download.redis.io/releases/redis-5.0.5.tar.gz

解壓 tar -xvf redis-5.0.5.tar.gz

cd redis-5.0.5/

2.編譯源文件

編譯測試 make test

最小安裝服務器可能會報錯:

   -bash: make: command not found

 

安裝對應服務

    yum -y install gcc automake autoconf libtool make

    yum install gcc gcc-c++

報出信息:You need tcl 8.5 or newer in order to run the Redis test

安裝tcl

wget https://sourceforge.net/projects/tcl/files/Tcl/8.6.9/tcl8.6.9-src.tar.gz

tar -zxvf tcl8.6.9-src.tar.gz

cd tcl8.6.9/unix

./configure

make

make install

返回redis-5.0.5目錄

重新執行 make test

編譯 make 

安裝 make PREFIX=/usr/local/redis install  (安裝到指定目錄)

 

 
 

3.配置啟動

 cp redis.conf /usr/local/redis

cd /usr/local/redis/

mkdir log

編輯redis.conf       

vim redis.conf    

1.后台啟動,daemonize yes      

2.綁定IP,bind 192.168.XX.XXX    

3.數據存放路徑,dir /usr/local/redis/log rdb存放的路徑 

4.指定持久化方式,appendonly yes

啟動:  ./bin/redis-server ./redis.conf

66790:C 11 Oct 2019 12:06:06.029 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

66790:C 11 Oct 2019 12:06:06.029 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=66790, just started

66790:C 11 Oct 2019 12:06:06.029 # Configuration loaded

查看是否啟動成功:

     ps aux | grep redis




轉載:https://www.jianshu.com/p/77f6415a0d39


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM