網上找了很多文章,發現不全而且有些問題,安裝很多次之后,總結一篇可以使用的,記錄之。
環境:Centos7+Redis 5.0,如果環境不符合,本篇僅供參考。
1、准備工作
作者習慣軟件安裝包放在單獨路徑,解壓路徑也放在單獨路徑。
下載路徑:mkdir -p /data/softwore
cd /data/software
2、軟件下載
redis包下載地址,可以下載后用ftp工具導入下載路徑中,也可以使用wget直接下載。
作者:wget http://download.redis.io/redis-stable.tar.gz
注:wget下載軟件,如果沒有指明路徑,會存放在當前路徑下(pwd查詢)。
3、解壓
tar -zxvf redis-stable.tar.gz -C /usr/local
4、編譯
cd /usr/local/redis-stable
make
提示如下就算完成。
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/usr/local/redis-5.0.0/src'
5、安裝
make install
提示如下就算完成。
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/usr/local/redis-5.0.0/src'
6、設置配置文件路徑
mkdir -p /etc/redis
cp redis.conf /etc/redis
7、修改配置文件
vi /etc/redis/redis.conf
僅修改: daemonize yes
8、啟動
/usr/local/bin/redis-server /etc/redis/redis.conf
9、查看運行情況
ps -ef | grep redis
下圖說明redis安裝成功,且只能本機(127.0.0.1)運行。
10、設置開機啟動
XXXXXXXXXX
如何用Redis Desktop Manager連接redis。請看: 用 Redis Desktop Manager 遠程連接 redis 數據庫。
安裝中遇到的問題,請看:Centos7 linux 安裝 redis 遇到的幾個問題。
redis 驗證密碼登錄,請看:XXXXXXXXXXXXXXXXXXXXXXXXX