ubuntu安裝Redis
安裝最新版:

 

cd download
wget HTTP://redis.googlecode.com/files/redis-2.4.17.tar.gz
tar -zxf redis-2.4.17.tar.gz
cd redis-2.4.17
make
sudo make install



第二步:測試,錯誤處理========
make test
出錯了:"You need 'tclsh8.5' in order to run the Redis test"
需要安裝 位址:HTTP://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html
其它安裝方法:sudo apt-get install tcl8.5 來安裝tcl。

 

安裝後測試 make test錯誤:

 

!!! WARNING The following tests failed:

 

*** [err]: Protocol desync regression test #3 in tests/unit/protocol.tcl
Redis did not closed connection after protocol desync
Cleanup: may take some time... OK
make[1]: *** [test] Error 1

 

解釋:
Do not worry about the error. I it is a bug in the test not in redis. It is a timing issue with the test, so the error happens sometimes and sometimes it does not. I think antirez will eventually fix that test, but we should be able to use redis correctly in the meantime.



第三步:redis.conf===
wget HTTPs://raw.github.com/gist/1164482/77e4ecf14ffac42b0e987e7ffe16cb757d734ff9/redis.conf
sudo mkdir /etc/redis
sudo mv redis.conf /etc/redis/redis.conf

 

第四步:redis-server====
wget HTTPs://raw.github.com/gist/1164503/d1bc2cc6782b943d9b28aa93fc7038f4ae5a905f/redis-server
sudo mv redis-server /etc/init.d/redis-server
sudo chmod +x /etc/init.d/redis-server

 

第五步:===
sudo useradd redis
sudo mkdir -p /var/lib/redis
sudo mkdir -p /var/log/redis
sudo chown redis.redis /var/lib/redis
sudo chown redis.redis /var/log/redis

 

第六步:===
讓Redis server作為啟動服務。
sudo update-rc.d redis-server defaults

 

啟動服務:
sudo /etc/init.d/redis-server start

 

第七步:測試
redis-cli
> set foo bar
OK
> get foo
"bar"
表示測試成功。

 

參考:
HTTP://blog.railsupgrade.com/2011/08/install-redis-server-on-ubuntu-maunally.html
HTTP://junnan.org/blog/1454
tclsh8.5: HTTP://blog.csdn.net/newlaide/article/details/7528036
安裝redis:HTTP://www.cnblogs.com/westfly/archive/2012/05/18/2507737.html
make test,error:HTTPs://github.com/antirez/redis/issues/325
install-redis-2-6-on-ubuntu: HTTP://www.codingsteps.com/install-redis-2-6-on-ubuntu/
創作者介紹
創作者 shadow 的頭像
shadow

資訊園

shadow 發表在 痞客邦 留言(0) 人氣()