使用Homebrew安裝redis能夠減小大量的安裝和配置的工做量。
安裝命令redis
brew install redis
ide
安裝完成後的提示信息測試
To have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don’t want/need launchctl, you can just run:
redis-server /usr/local/etc/redis.confspa
開機啓動redis命令code
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgentsorm
使用launchctl啓動redis serverserver
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plisthomebrew
使用配置文件啓動redis serverit
$ redis-server /usr/local/etc/redis.confclass
中止redis server的自啓動
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
redis 配置文件的位置
/usr/local/etc/redis.conf
卸載redis和它的文件
$ brew uninstall redis
$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
測試redis server是否啓動
$ redis-cli ping