简介

Redis时一个开源的非关系数据库,支持持久化存储。

安装

Mac os x下安装Redis很简单通过Brew安装即可。

如果没有安装 Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

首先,获取最新软件安装包

brew update

安装Redis

brew install redis

结果:

==> Downloading https://homebrew.bintray.com/bottles/redis-3.0.7.yosemite.bottle
######################################################################## 100.0%
==> Pouring redis-3.0.7.yosemite.bottle.1.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

启动命令:

redis-server

指定端口启动

redis-server --port 6380

停止命令:

redis-cli shutdown
wn