Redis 3.x.x系列的安裝於之前的2.x.x略有不同,需要先編譯依賴。 ...
文章環境: 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
#好了,就這些,嘗試一下吧。
簡單提示:
- 當前版本中需要編譯的依賴有五項,更早或未來的版本可能會有不同。如果您沒有編譯這些項目,編譯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
- 在使用腳本安裝服務的過程中,您可以一路【Enter】完成安裝。之後您可以再次運行腳本文件,並通過輸入不同的埠號建立多個Redis服務。
相關資源和參考:
- 博客文章:Install redis 3.0 from source on Ubuntu 14.04 / CentOS 7 / RHEL 7
- CentOS官方網站:CentOS Project
- Redis官方網站:Redis
- Redis中文參考:Redis中文官方網站