11月 122019
mac下安装redis命令:
brew install redis
如果没有安装homebrew,可以打开一个终端,输入下面命令安装:
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
启动:
redis-server 命令直接启动会运行在一个终端里,关闭终端服务就停止了,也没有运行参数可以后台运行,但可以通过修改配置文件参数实现。
mac下brew安装的redis的配置文件默认所在位置: /usr/local/etc/redis.conf
修改: 将 daemonize no 修改为 daemonize yes
再启动
redis-server /usr/local/etc/redis.conf
redis就会后台运行了
如果要开机启动,使用下面命令:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
brew services start redis
Sorry, the comment form is closed at this time.