You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
762 B
18 lines
762 B
# 安装Redis
|
|
docker pull swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/redis:latest
|
|
docker tag swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/redis:latest docker.io/redis:latest
|
|
|
|
## 创建目录
|
|
mkdir -p /opt/redis/conf
|
|
mkdir -p /opt/redis/data
|
|
|
|
## 创建文件
|
|
touch /opt/redis/conf/redis.conf
|
|
|
|
# 修改配置文件
|
|
vi /opt/redis/conf/redis.conf
|
|
protected-mode no
|
|
bind 0.0.0.0
|
|
|
|
# Docker 创建 Redis 容器命令
|
|
docker run --restart=always --log-opt max-size=100m --log-opt max-file=2 -p 18890:6379 --name redis -v /opt/redis/conf/redis.conf:/etc/redis/redis.conf -v /opt/redis/data:/data -d swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/redis redis-server /etc/redis/redis.conf --appendonly yes --requirepass DsideaL147258369 |