在CentOS 7中安裝Redis 3.2.8


文章環境:
CentOS 7 biuld 1611最小化安裝@VMware
Redis 3.2.8

安裝步驟:

#安裝gcc
yum -y install gcc
#下載redis
curl -O  http://download.redis.io/releases/redis-3.2.8.tar.gz
#解壓
tar -zxvf redis-3.2.8.tar.gz
#轉換目錄
cd redis-3.2.8/deps/
#編譯依賴
make geohash-int hiredis jemalloc linenoise lua
#轉換目錄
cd ..
#編譯Redis
make && make install
#轉換目錄
cd utils/
#使用腳本安裝服務
./install_server.sh
#啟動服務
systemctl start redis_6379
systemctl status redis_6379
#好了,就這些,嘗試一下吧。

簡單提示:

  1. 當前版本中需要編譯的依賴有五項,更早或未來的版本可能會有不同。如果您沒有編譯這些項目,編譯Redis會遇到錯誤。
    fatal error: jemalloc/jemalloc.h: No such file or directory
    cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
    cc: error: ../deps/lua/src/liblua.a: No such file or directory
    cc: error: ../deps/geohash-int/geohash.o: No such file or directory
    cc: error: ../deps/linenoise/linenoise.o: No such file or directory
  2. 在使用腳本安裝服務的過程中,您可以一路【Enter】完成安裝。之后您可以再次運行腳本文件,並通過輸入不同的端口號建立多個Redis服務。

相關資源和參考:


免責聲明!

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



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