Mac环境下Redis的安装

1.下载

官网下载地址:https://redis.io/download,选择对应的下载版本,我下载的是4.0.12

2.安装

1)下载文件解压后复制到/usr/local/目录下(快速找到路径小技巧:终端输入:cd /usr/local/ 打开 open .)

若复制过程中有验证提示,输入电脑密码即可

2)切换到相应目录

cd /usr/local/redis-4.0.12/

3)测试编译

sudo make test
打印日志
Password:
cd src && /Library/Developer/CommandLineTools/usr/bin/make test
    CC Makefile.dep
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
...

提示Password提示输入密码

4)编译安装

sudo make install

cd src && /Library/Developer/CommandLineTools/usr/bin/make install

    CC Makefile.dep

    INSTALL redis-sentinel

    CC redis-cli.o

    LINK redis-cli

    CC redis-benchmark.o

    LINK redis-benchmark

    INSTALL redis-check-rdb

 

Hint: It's a good idea to run 'make test' ;)

 

    INSTALL install

    INSTALL install

    INSTALL install

    INSTALL install

    INSTALL install

5).启动 redis

redis-server
11191:C 22 Dec 21:09:09.739 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
11191:C 22 Dec 21:09:09.740 # Redis version=4.0.12, bits=64, commit=00000000, modified=0, pid=11191, just started
11191:C 22 Dec 21:09:09.740 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
11191:M 22 Dec 21:09:09.741 * Increased maximum number of open files to 10032 (it was originally set to 256).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.12 (00000000/0) 64 bit
  .-`` .-```.  ```/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 11191
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

11191:M 22 Dec 21:09:09.742 # Server initialized
11191:M 22 Dec 21:09:09.742 * Ready to accept connections

原文地址:https://www.cnblogs.com/zimengfang/p/10162636.html