Github 地址 https://github.com/antirez/redis
1. 下載安裝包
當前最新版本為5.0.5
2. 解壓安裝
$tar xzf redis-5.0.5.tar.gz
$cd redis-5.0.5
$make
在安裝時候如果提示
`invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun`
則需要安裝 Xcode toolkit,參考 https://ma.ttias.be/mac-os-xcrun-error-invalid-active-developer-path-missing-xcrun/
xcode-select --install
然后再繼續make
安裝完成以后在當前目錄下會新建src目錄,內含編譯后的redis-server和redis-cli
3. 啟動redis
$ cd src/
$ ./redis-server
如果要使用自己的配置文件則使用
$ ./redis-server /path/to/redis.conf
服務端默認綁定127.0.0.1 端口號為 6379
4. 啟動客戶端
$ ./redis-cli
5. 測試命令