摘要:
redis-operator使用的了quay.io/opstree/redis:v6.2.5, 记录对于redis配置的处理
redis-operator使用的镜像:
redis镜像:
quay.io/opstree/redis:v6.2.5
redis-export:
quay.io/opstree/redis-exporter:1.0
redis镜像本地查看:
拉取容器 docker pull quay.io/opstree/redis:v6.2.5
[root@node-203 etc]# docker pull quay.io/opstree/redis:v6.2.5v6.2.5: Pulling from opstree/redis31603596830f: Pull complete 7616f12aad37: Downloading [=======================================> ] 47.02MB/59.96MBe86286b96d42: Download complete 7616f12aad37: Downloading [=========================================> ] 50.27MB/59.96MB7616f12aad37: Pull complete e86286b96d42: Pull complete 5ba60bb2ca23: Pull complete e5f699b7389f: Pull complete 80ebf45ce2df: Pull complete 27122c4dad84: Pull complete e81a2e5fa5c6: Pull complete 722ea2b86b77: Pull complete Digest: sha256:f135b0fdc5dbbeface7322897f493504e22a1bdc0830eeade56c521a6dedd18bStatus: Downloaded newer image for quay.io/opstree/redis:v6.2.5quay.io/opstree/redis:v6.2.5 |
运行容器 docker run
[root@node-203 etc]# docker run --name redis-alone -d quay.io/opstree/redis:v6.2.581d0d1eeab5294e7ce8701cf6ea165f247042945f6c8e92ea1d23abc595648b4 |
[root@node-203 ~]# docker ps | grep redis81d0d1eeab52 quay.io/opstree/redis:v6.2.5 "/usr/bin/entrypoint…" 11 minutes ago Up 11 minutes 6379/tcp redis-alone |
进入容器:
[root@node-203 etc]# docker exec -it 81d0d1eeab52 /bin/bashbash-4.4# bash-4.4# bash-4.4# bash-4.4# ps -efPID USER TIME COMMAND 1 root 0:00 {entrypoint.sh} /bin/bash /usr/bin/entrypoint.sh 10 root 0:00 redis-server 0.0.0.0:6379 15 root 0:00 /bin/bash 21 root 0:00 ps -ef |
redis使用的配置的结论:
- 容器中redis的启动并没有指定配置文件, 而是直接使用redis代码中的默认配置
redis的配置:
使用config rewrite命令, 将配置回写到本地文件, 内容如下:
bash-4.4# cat /etc/redis/redis.conf bind 0.0.0.0protected-mode yestcp-backlog 511timeout 0tcp-keepalive 300daemonize nosupervised nopidfile "/var/run/redis.pid"# Generated by CONFIG REWRITEsave 3600 1save 300 100save 60 10000user default on nopass ~* &* +@alldir "/data" |