当前位置:网站首页>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
边栏推荐
- node の SQLite
- 287. Find duplicates
- Jerry's watch deletes the existing dial file [chapter]
- MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...
- [swoole series 2.1] run the swoole first
- J'aimerais dire quelques mots de plus sur ce problème de communication...
- Declval (example of return value of guidance function)
- epoll()无论涉及wait队列分析
- Tree-LSTM的一些理解以及DGL代码实现
- Take you through ancient Rome, the meta universe bus is coming # Invisible Cities
猜你喜欢
Distiller les connaissances du modèle interactif! L'Université de technologie de Chine & meituan propose Virt, qui a à la fois l'efficacité du modèle à deux tours et la performance du modèle interacti
2019阿里集群数据集使用总结
Ms-tct: INRIA & SBU proposed a multi-scale time transformer for motion detection. The effect is SOTA! Open source! (CVPR2022)...
Recommend easy-to-use backstage management scaffolding, everyone open source
Self-supervised Heterogeneous Graph Neural Network with Co-contrastive Learning 论文阅读
Declval (example of return value of guidance function)
30 分钟看懂 PCA 主成分分析
模板于泛型编程之declval
J'aimerais dire quelques mots de plus sur ce problème de communication...
declval(指导函数返回值范例)
随机推荐
【.NET CORE】 请求长度过长报错解决方案
Alibaba cloud international ECS cannot log in to the pagoda panel console
第三季百度网盘AI大赛盛夏来袭,寻找热爱AI的你!
图之广度优先遍历
Coco2017 dataset usage (brief introduction)
30 minutes to understand PCA principal component analysis
JDBC驱动器、C3P0、Druid和JDBCTemplate相关依赖jar包
Dichotomy (integer dichotomy, real dichotomy)
echart简单组件封装
Jerry's watch reading setting status [chapter]
Compilation Principle -- C language implementation of prediction table
从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
Jerry's watch deletes the existing dial file [chapter]
CRMEB 商城系统如何助力营销?
[Android] kotlin code writing standardization document
Recursive way
C语言自动预订飞机票问题
關於這次通信故障,我想多說幾句…
Codeforces Round #803 (Div. 2)
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"