sh 通过Homebrew安装Redis

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 通过Homebrew安装Redis相关的知识,希望对你有一定的参考价值。

#!/bin/bash
brew install redis  # Install Redis using Homebrew
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents  # Enable Redis autostart

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist  # Start Redis server via launchctl
# homebrew.mxcl.redis.plist contains reference to redis.conf file location: /usr/local/etc/redis.conf 

redis-server /usr/local/etc/redis.conf # Start Redis server using configuration file, Ctrl+C to stop
redis-cli ping # Check if the Redis server is running

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist # Disable Redis autostart

以上是关于sh 通过Homebrew安装Redis的主要内容,如果未能解决你的问题,请参考以下文章

sh 使用Lua和Python通过Homebrew安装MacVim

homebrew

Homebrew安装Redis找不到redis.conf文件

sh 安装Homebrew

sh 安装homebrew文件

sh 安装和设置Homebrew