当前位置:网站首页>Docker installation redis
Docker installation redis
2022-07-06 18:29:00 【A vegetable chicken that is working hard】
Docker install Redis
1. download redis Mirror image

2. Create a local directory to facilitate data volume mapping
- Create a directory structure as follows

- download redis.conf And modify the configuration
1. Basic configuration
#bind 127.0.0.1 # Comment out , send redis Can be accessed externally
requirepass a # to redis Set the password a
logfile/data/redis.log # Specify log files
protected-mode no # Turn off protection mode
2.RDB Basic configuration of data file
# Set up RDB File name and file path
dbfilename dump.rdb # Default
dir /data #./ Change to /data
# Set the snapshot interval , The pressure can be adjusted according to the actual request
save 3600 1 #3600s There are 1 strip key Change is a snapshot , Low pressure
save 300 100 #300s There are 10 strip key Change is a snapshot
save 60 10000 #60s There are 10000 strip key Change is a snapshot , High pressure
#redis It's a memory library , But memory is afraid of shutdown , So we should persist the data to disk in time
rdbcompression yes # Backup file compression
rdbchecksum yes # Check code
stop-writes-on-bgsave-error yes # Persistence error , Whether the main program stops writing
3.AOF Basic configuration of log file
appendonly yes #AOF Append mode backup
dir /data # Backup file storage location
aof-use-rdb-preamble yes # Mixed persistence
3. start-up redis
- There is an error in the statement in the figure , The correct command is in the following code

docker run -itd --name redis -p 6379:6379 --restart=always -v d:\dockercontainers\redis\redis.conf:/etc/redis/redis.conf -v d:\dockercontainers\redis\data:/data redis redis-server /etc/redis/redis.conf
4. Into the container
docker exec -it redis /bin/bash
5. download redis Software , Test connection


边栏推荐
猜你喜欢
随机推荐
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Implementation of queue
Compilation principle - top-down analysis and recursive descent analysis construction (notes)
D binding function
Jielizhi obtains the customized background information corresponding to the specified dial [chapter]
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
POJ 2208 six lengths of tetrahedron are known, and the volume is calculated
C语言自动预订飞机票问题
Coco2017 dataset usage (brief introduction)
Introduction to the usage of model view delegate principal-agent mechanism in QT
[sword finger offer] 60 Points of N dice
287. Find duplicates
First, look at K, an ugly number
十、进程管理
Declval (example of return value of guidance function)
Jerry's watch reads the file through the file name [chapter]
MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...
Cobra 快速入门 - 专为命令行程序而生
Compilation Principle -- C language implementation of prediction table









