前提
・homebrewがインストールされている
redisインストール
$ brew install redis
==> Downloading https://homebrew.bintray.com/bottles/redis-3.0.5.el_capitan.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/redis-3.0.5.el_capitan.bottle.tar.gz
==> Pouring redis-3.0.5.el_capitan.bottle.tar.gz
==> Caveats
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
==> Summary
🍺 /usr/local/Cellar/redis/3.0.5: 9 files, 892K
$
ログイン時、自動起動するように登録
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
今すぐサーバー起動する。
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
redis設定ファイルの場所
/usr/local/etc/redis.conf
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
...
起動して確認
$ redis-cli
127.0.0.1:6379> set 'a' 111
OK
127.0.0.1:6379> get 'a'
"111"
127.0.0.1:6379> exit
$