node-redis:mac 安装配置redis

windows 请移步: https://www.jianshu.com/p/f057a72bd481
配置文件mac和windows一致,windows用户请参考下述配置;

1.下载redis客户端

http://download.redis.io/releases/

2.解压压缩包,进入redis文件夹根目录,命令行 :“make” 命令进行编译

如: daiyunzhoudeMacBook-Pro:redis-5.0.2 daiyunzhou$ make

3.启动redis服务器

如: daiyunzhoudeMacBook-Pro:redis-5.0.2 daiyunzhou$ src/redis-server

4.如下图所示,即为安装成功redis


7450593-126f9e0c319c4ad3.png
image.png

5.通过src/redis-server启动的是默认的redis配置,需要修改配置,否则会出现如下警告:

Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf

6.在src/redis-server 后面添加指定的配置文件路径即可:

如: daiyunzhoudeMacBook-Pro:redis-5.0.2 daiyunzhou$ src/redis-server /Users/daiyunzhou/code/redis-5.0.2/redis.conf

7.设置允许访问redis服务的白名单:

bind 127.0.0.1 192.168.0.103

7450593-56514bfa26f9833f.png
image.png

8.设置端口号:

7450593-0fdff0eaf934888c.png
image.png

9.设置密码:

7450593-8d1ba7e724825348.png
image.png

10.链接redis

7450593-4aeb2e1e1311f06a.png
image.png

猜你喜欢

转载自blog.csdn.net/weixin_34232617/article/details/87028416