使用brew安装Redis
brew install redis
执行上述命令后出现以下,则成功安装:
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/redis-6.0.10
######################################################################## 100.0%
==> Pouring redis-6.0.10.mojave.bottle.tar.gz
==> Caveats
To have launchd start redis now and restart at login:
brew services start redis
Or, if you don't want/need a background service you can just run:
redis-server /usr/local/etc/redis.conf
==> Summary
/usr/local/Cellar/redis/6.0.10: 13 files, 3.7MB
Mac安装后路径
配置redis.conf
配置文件路径:/usr/local/etc/redis.conf
编辑配置文件
vim /usr/local/etc/redis.conf
# 找到 bind 将其注释
#bind 127.0.0.1
# 找到 protected-mode 值改为 no
protected-mode yes 改为 no
# 设置后台运行
daemonize no 改为 yes
保存使用命令"esc:wq 回车"(冒号不可省略)
启动redis
/usr/local/Cellar/redis/6.0.10/bin/redis-server /usr/local/etc/redis.conf &
查看redis进程,默认端口号:6379
ps -ef|grep redis
运维工程师QQ在线交流群:580175957