http://jingyan.baidu.com/article/948f592401d172d80ff5f99a.html (最簡單)html
http://blog.csdn.net/jy0902/article/details/19248299redis
http://www.cnblogs.com/moxiaoan/p/5724505.html測試
下載按照redis源碼(官網有安裝啓動步驟):ui
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xvf redis-2.8.19.tar.gz
cd redis-2.8.19.net
若安裝make報錯:
安裝make ( sudo apt-get install make)server
安裝build-essential(sudo apt-get install build-essential)htm
報錯:fatal error: jemalloc/jemalloc.h: No such file or directory
make MALLOC=jemallocblog
若報錯:fatal error: jemalloc/jemalloc.h: No such file or directory進程
make MALLOC=libcget
若報錯:collect2: error: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/home/xinxin/downloads/redis-stable/src'
make: *** [all] Error 2
解決方法:編輯src/.make-settings裏的OPT,改成OPT=-O2 -march=i686
1,sudo su //進入root權限
二、mkdir download //新建一個文件夾,名爲「download」
三、cd download //進入download文件夾,下載最新穩定版redis安裝包
wget http://download.redis.io/releases/redis-3.2.4.tar.gz
四、tar xvf redis-3.2.4.tar.gz //解壓
五、這時cd download文件夾,ls命令,能夠看到,解壓後的文件夾"redis-stable"
cd redis-stable
make //編譯
make成功後,會在src下生成6個可執行文件:
redis-server, redis-cli, redis-benchmark, redis-check-aof, redis-check-dump,redis-sentinel
安裝redis成功後,可在/usr/local/redis看到一個bin目錄,裏面有以下文件:
redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
sudo apt-get install tcl8.5
make test //這句話僅用於測試
測試成功,OK
which redis-server //看安裝地址
/usr/local/bin/redis-server //能夠看到,redis安裝在/usr/local/bin/目錄下
接下來,啓動redis:/usr/local/bin/redis-server
啓動的端口爲6379,能夠在啓動的時候指定具體的配置文件,在配置文件中指出啓動的端口。
查看redis進程: ps - ef|grep redis