Redis 安装 - macOS


Github 地址 https://github.com/antirez/redis

1. 下载安装包

https://redis.io/download

当前最新版本为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. 测试命令

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM