安装Redis,启动端口6379:
brew install redis
Redis安装目录:/opt/homebrew/Cellar/redis/7.2.6/
Redis配置文件目录:/opt/homebrew/etc/redis.conf
bind 0.0.0.0
protected-mode no
port 6379
timeout 0
save 900 1 300 10 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /opt/homebrew/var/db/redis
appendonly yes
appendfsync everysec
requirepass 密码
踩坑:redis启动失败,RDB持久化文件目录需要授权:
sudo chmod -R 777 /opt/homebrew/var/db
sudo chmod -R 777 /opt/homebrew/var/db/redis
RDB持久化文件目录:
dir /opt/homebrew/var/db/redis/
启动Redis:
brew services start redis
Redis客户端:
redis-cli -a 密码