下载
redis-3.0.7.tar.gz官网地址:
解压
tar -zvxf redis-3.0.7.tar.gz
将解压后的文件夹放到 /usr/local目录下
编译测试
接下来在终端中切换到/usr/local/redis目录下,输入:sudo make test
备注:如果mac上没有xcode,会下载编译包,点击下载即可
显示结果:
43 seconds - integration/replication-4 28 seconds - unit/obuf-limits 48 seconds - integration/replication 111 seconds - integration/replication-psync\o/ All tests passed without errors!Cleanup: may take some time... OK\o/ All tests passed without errors!
编译安装:在终端中输入命令:
sudo make install
显示结果:
cd src && /Library/Developer/CommandLineTools/usr/bin/make install INSTALL redis-sentinel CC redis-cli.o LINK redis-cli CC redis-benchmark.o LINK redis-benchmark CC redis-check-dump.o LINK redis-check-dumpHint: It's a good idea to run 'make test' ;) INSTALL install INSTALL install INSTALL install INSTALL install INSTALL install
启动Redis,输入命令
redis-server
显示结果:
_.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.0.7 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 11715 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-'