当前位置:网站首页>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
边栏推荐
- Jerry's watch reading setting status [chapter]
- Jerry's watch deletes the existing dial file [chapter]
- Redis的五种数据结构
- std::true_ Type and std:: false_ type
- Will openeuler last long
- D binding function
- 图片缩放中心
- FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
- [.Net core] solution to error reporting due to too long request length
- CSRF vulnerability analysis
猜你喜欢
随机推荐
文档编辑之markdown语法(typora)
F200 - UAV equipped with domestic open source flight control system based on Model Design
CSRF vulnerability analysis
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
High precision operation
图片缩放中心
Compilation Principle -- C language implementation of prediction table
Maixll dock camera usage
CRMEB 商城系统如何助力营销?
模板于泛型编程之declval
转载:基于深度学习的工业品组件缺陷检测技术
【中山大学】考研初试复试资料分享
Grafana 9.0 正式发布!堪称最强!
Self-supervised Heterogeneous Graph Neural Network with Co-contrastive Learning 论文阅读
2022暑期项目实训(二)
十、进程管理
ADB common commands
阿里云国际版ECS云服务器无法登录宝塔面板控制台
Interesting - questions about undefined
【LeetCode第 300 场周赛】