docker安装redis

Java65
  1. 拉取镜像 默认拉取最新
docker pull redis
  1. 设置配置文件

  2. bind 127.0.0.1 #注释掉这部分,这是限制redis只能本地访问

  3. protected-mode no #默认yes,开启保护模式,限制为本地访问
  4. daemonize no#默认no,改为yes意为以守护进程方式启动,可后台运行,除非kill进程(可选),改为yes会使配置文件方式启动redis失败
  5. dir ./ #输入本地redis 数据库存放文件夹(可选)
  6. appendonly yes #redis持久化(可选) 下面是我修改好的配置文件 我用的版本是6.0.8 其他版本可能不适合

```xml

Redis configuration file example.

Note that in order to read the configuration file, Redis must be

started with the file path as first argument:

输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长