基于KubeSphere在K8S发布微服务ruoyi----4.部署基础环境Redis

dockerhub查看redis启动所需相关参数

https://hub.docker.com/_/redis

If persistence is enabled, data is stored in the VOLUME /data, which can be used with --volumes-from some-volume-container or -v /docker/host/dir:/data

   

   

自定义启动redis

   

   

   

Dockerredis写法

#创建配置文件

## 准备redis配置文件内容K8S写到configmap当中)

mkdir -p /mydata/redis/conf

   

vim /mydata/redis/conf/redis.conf

##配置示例

appendonly yes

port 6379

bind 0.0.0.0

   

#docker启动redis

docker run -d -p 6379:6379 --restart=always \

-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \

-v /mydata/redis-01/data:/data \

--name redis-01 redis:6.2.5 \

redis-server /etc/redis/redis.conf

   

   

   

   

   

##配置示例

appendonly yes

port 6379

bind 0.0.0.0

   

   

   

自定义启动命令在这个位置设置

redis-server /etc/redis/redis.conf

   

   

   

   

   

   

   

/etc/redis/redis.conf

   

   

   

   

 

 

连接测试工具

官网下载:https://redisdesktop.com/download

posted @ 2023-01-25 12:29  ST运维  阅读(233)  评论(0编辑  收藏  举报