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. 测试命令

 

 

posted @ 2020-04-01 14:16  pkyou  阅读(1922)  评论(0编辑  收藏  举报