在mac上通過Homebrew安裝redis

使用Homebrew安裝redis可以減少大量的安裝和配置的工作量。

安裝命令
brew install redis
安裝完成後的提示信息

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.conf

開機啓動redis命令
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

使用launchctl啓動redis server
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

使用配置文件啓動redis server
$ redis-server /usr/local/etc/redis.conf

停止redis server的自啓動
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

redis 配置文件的位置
/usr/local/etc/redis.conf

卸載redis和它的文件
brewuninstallredis
rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

測試redis server是否啓動
$ redis-cli ping

brew services start redis

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章