1. 程式人生 > >Mac環境下Redis的安裝

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