LoginSignup
11
14

More than 5 years have passed since last update.

macOS に Redis を Homebrew でインストールして brew services で起動する

Posted at

macOS に Redis を Homebrew でインストールして brew services で起動する方法をメモっとく。

Redis を Homebrew でインストールする

Homebrew を最新にしてから Redis をインストールする。

$ brew update
$ brew install redis

Redis を起動する

この記事では Homebrew のサービス管理機能である Homebrew/homebrew-services を使用する。

Redis は brew services start redis で起動できる。

$ brew services start redis
==> Successfully started `redis` (label: homebrew.mxcl.redis)

brew services を利用することで、macOS の launchctl で plist を登録したり、登録解除したりする作業が不要になる。自動的に launchctl に登録されるので、macOS を起動するたびに Redis が自動起動する点は注意してほしい。

また、brew services list で起動状況が確認できる。

$ brew services list
Name        Status  User   Plist
redis       started takuya /Users/takuya/Library/LaunchAgents/homebrew.mxcl.redis.plist

Redis を停止する

Redis は brew services stop redis で停止できる。

$ brew services stop redis
Stopping `redis`... (might take a while)
==> Successfully stopped `redis` (label: homebrew.mxcl.redis)

参考文献

OS X に PostgreSQL を Homebrew でインストールして brew services で起動する

11
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
14