一、獲取安裝檔案
$ pwd
/user/***
$ wget http://download.redis.io/releases/redis-3.2.3.tar.gz
二、解壓檔案並移動檔案
$ tar xzf redis-3.2.3.tar.gz
$ mv redis-3.2.3 /usr/local/redis
三、進入資料夾目錄
$ cd /usr/local/redis
四、編譯安裝
$ make
五、安裝依賴包
$ cd src && make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] 錯誤 1
$ yum install tcl
已載入外掛:fastestmirror, security
設定安裝程式
Loading mirror speeds from cached hostfile
.............
六、再次編譯安裝
$ make
$ cd src
$ make test
七、make test報錯及修改
[err]: Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/integration/replication-psync.tcl
Expected condition `[s -1 sync_partial_ok] > 0` to be true ([s -1 sync_partial_ok] > 0)
出現這個問題的原因可能是"測試點在配置比較低的機器上會因為超時而過不了"
在解壓目錄中修改
# vi tests/integration/replication-psync.tcl
把 after 100 改成 after 500
八、設定配置檔案路徑
$ mkdir /etc/redis
$ cp /usr/local/redis/redis.conf /etc/redis
九、加入開機啟動
echo "/usr/local/redis/src/redis-server /etc/redis/redis.conf &" >> /etc/rc.local
十、啟動redis-server 及redsi-cli
$ /usr/local/redis/src/redis-server /etc/redis/redis.conf &
$ /usr/local/redis/src/redis-cli