使用Docker部署Redis
一、首先拉取镜像
docker pull redis
二、创建 Redis 配置文件
mkdir -p /home/redis/conf
touch /home/redis/conf/redis.conf
三、创建并启动 Redis 容器
docker run -d --name redis
-p 6379:6379
--restart unless-stopped
-v /home/redis/data:/data
-v /home/redis/conf/redis.conf:/etc/redis/redis.conf
redis:latest redis-server /etc/redis/redis.conf
四、修改 Redis 配置文件
例如:
启用持久化功能:
appendonly yes
设置密码:
requirepass
本文来自博客园,作者:William202020,转载请注明原文链接:https://www.cnblogs.com/william2020/articles/18965758