redis安裝部署

1.下載安裝包

http://download.redis.io/releases/redis-3.2.6.tar.gz
http://download.redis.io/releases/

2.更新現有linux環境

sudo yum –y update;
sudo yum -y install telnet curl nmap vim gcc gcc-c++ tcl ruby;

3.安裝

1 tar -xvf redis-3.2.6.tar.gz 
2 cd redis-3.2.6
3 make4 make test
5 sudo make install

4.優化redis目錄

a.移動不使用的文件

1 mkdir others
2 mv 00-RELEASENOTES BUGS CONTRIBUTING COPYING INSTALL Makefile MANIFESTO README.md runtest runtest-cluster runtest-sentinel others/

b.建立配置文件目錄與啓動腳本目錄

mkdir conf
mv redis.conf conf/
mv sentinel.conf conf/

mkdir bin
cd src 
mv redis-server redis-cli redis-sentinel ../bin

c.建立pid文件與日誌目錄

1 mkdir run 6379 26379 logs
2 touch ./run/redis_6379.pid
3 touch ./run/redis_26379.pid
4 touch ./logs/redis_6379.log
5 touch ./logs/redis_26379.log

 

 

錯誤解決:

1.第3步make 報錯linux

missing initializer for field ‘longitude’ of ‘GeoHashArea’c++

可使用  git

make MALLOC=libc 替換 makeredis

2.make test 報錯vim

*** [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)
Cleanup: may take some time... OK
make[1]: *** [test] Error 1

redis 安裝在vmware虛擬機上會出現這個錯誤,在實體機以及阿里雲不會出現,解決方法是vi tests/integration/replication-psync.tcl 根據報錯提示將after後面的數字,從100改爲 500ruby

必定要顯示less

\o/ All tests passed without errors!curl

這樣的提示。優化

相關文章
相關標籤/搜索