004_手把手教程_Mac上安装Redis和Redis客户端

Redis是高效的内存数据库,我们今天在Mac上面把开发环境搭建起来,为后面和springboot整合做准备。具体如何使用redis可以参考我在iteye上面写的系列文章:http://www.iteye.com/blogs/subjects/KillRedis

现在开始搭建环境吧

1.使用berw安装redis

打开终端。在终端使用命令:

brew search redis
brew install redis

这样就安装完毕了。开始测试一下吧

redis-server
2261:C 01 Sep 15:05:19.655 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
2261:C 01 Sep 15:05:19.656 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=2261, just started
2261:C 01 Sep 15:05:19.656 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
2261:M 01 Sep 15:05:19.657 * Increased maximum number of open files to 10032 (it was originally set to 256).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.1 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 2261
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

2261:M 01 Sep 15:05:19.661 # Server initialized

2.下载redis客户端软件。

推荐使用redis desktop manager for mac 破解版。下载地址:http://download.csdn.net/download/chaojixiaozhu/9960318
这个时候你就可以直接链接上你的redis服务器了,但是是没有密码的链接。正常我们是需要密码登陆这样安全一点。

3.设置redis登陆密码

找到Mac上面的redis.conf文件。一般文件目录在:

zhuchaodeMacBook-Pro:etc zhuchao$ pwd
/usr/local/etc
zhuchaodeMacBook-Pro:etc zhuchao$ ls
bash_completion.d   my.cnf          redis.conf
dump.rdb        openssl         zookeeper
gitconfig       redis-sentinel.conf

可以看到在/usr/local/etc/redis.conf文件
在文件中增加:

requirepass redis

那么redis就是你链接redis服务的密码。更多相关配置可以参考上面给出的redis系列文章。
redis安装完毕,下面我们准备将redis集成到springboot

你可能感兴趣的:(004_手把手教程_Mac上安装Redis和Redis客户端)