当前位置:网站首页>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
边栏推荐
- SQL优化问题的简述
- std::true_ Type and std:: false_ type
- Cobra 快速入门 - 专为命令行程序而生
- 简单易用的PDF转SVG程序
- 图片缩放中心
- 287. Find duplicates
- I want to say more about this communication failure
- Interview shock 62: what are the precautions for group by?
- A method of sequentially loading Unity Resources
- [.Net core] solution to error reporting due to too long request length
猜你喜欢
std::true_type和std::false_type
从交互模型中蒸馏知识!中科大&美团提出VIRT,兼具双塔模型的效率和交互模型的性能,在文本匹配上实现性能和效率的平衡!...
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
30 minutes to understand PCA principal component analysis
Why does wechat use SQLite to save chat records?
Recommend easy-to-use backstage management scaffolding, everyone open source
std::true_ Type and std:: false_ type
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
Windows connects redis installed on Linux
2019 Alibaba cluster dataset Usage Summary
随机推荐
使用cpolar建立一个商业网站(1)
Markdown grammar - better blogging
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
DOM Brief
JDBC驱动器、C3P0、Druid和JDBCTemplate相关依赖jar包
测试1234
用友OA漏洞学习——NCFindWeb 目录遍历漏洞
Redis的五种数据结构
2022 Summer Project Training (I)
STM32+HC05串口蓝牙设计简易的蓝牙音箱
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Ms-tct: INRIA & SBU proposed a multi-scale time transformer for motion detection. The effect is SOTA! Open source! (CVPR2022)...
FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
POJ 2208 已知边四面体六个长度,计算体积
The latest financial report release + tmall 618 double top, Nike energy leads the next 50 years
Jerry's watch deletes the existing dial file [chapter]
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
C语言高校实验室预约登记系统
Declval (example of return value of guidance function)