教你通过Homebrew安装配置Redis

藏色散人
藏色散人 转载
2020-10-20 14:13:47 1667浏览

下面由Redis教程栏目给大家介绍通过Homebrew安装配置Redis,希望对需要的朋友有所帮助!

背景

通过 Homebrew (https://brew.sh/), 在本地机器上安装&配置 Redis

安装 Redis

$ brew install redis

Redis 相关配置

电脑开机时, 启动 Redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

通过 "launchctl" 启动 Redis

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

以指定配置文件启动 Redis

$ redis-server /usr/local/etc/redis.conf

停止当前加载的 Agent

$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

默认配置文件的位置

cat /usr/local/etc/redis.conf

卸载 Redis 和相关配置

$ brew uninstall redis
$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

获取 Redis 相关信息

$ brew info redis

校验 Redis 是否运行

$ redis-cli ping

如果正常运行, 响应 PONG

以上就是教你通过Homebrew安装配置Redis的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:segmentfault,如有侵犯,请联系admin@php.cn删除