赞
踩
之前已经写过Redis分别在Linux、Windows上安装部署,及其集群环境搭建。
这次写一篇Docker容器部署Redis的教程,配置文件方式启动服务。
mkdir -p /data/redis/conf
wget http://download.redis.io/redis-stable/redis.conf
chmod 777 redis.conf
# 这行要注释掉,解除本地连接限制
# bind 127.0.0.1 -::1
# 默认yes,如果设置为yes,则只允许在本机的回环连接,其他机器无法连接。
protected-mode no
# 设置密码
requirepass 123456
docker run --name redis \
--restart=always \
-p 6379:6379 \
-v /data/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf
参数说明:
docker ps
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。