CentOS6 編譯安裝 redis-3.2.3

1、獲取安裝文件

$ pwd
/user/***
$ wget http://download.redis.io/releases/redis-3.2.3.tar.gz

2、解壓文件並移動文件

$ tar xzf redis-3.2.3.tar.gz
$ mv redis-3.2.3 /usr/local/redis

3、進入文件夾目錄

$ cd /usr/local/redis

4、編譯安裝

$ make

5、安裝依賴包

$ 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
.............

6、再次編譯安裝

$ make 
$ cd src 
$ make test

7、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

8、設置配置文件路徑

$ mkdir /etc/redis
$ cp /usr/local/redis/redis.conf /etc/redis

9、加入開機啓動

echo "/usr/local/redis/src/redis-server /etc/redis/redis.conf &" >> /etc/rc.local

10、啓動redis-server 及redsi-cli

$ /usr/local/redis/src/redis-server /etc/redis/redis.conf &

$ /usr/local/redis/src/redis-cli
相關文章
相關標籤/搜索