当前位置:网站首页>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


边栏推荐
- First, look at K, an ugly number
- 阿里云国际版ECS云服务器无法登录宝塔面板控制台
- Will openeuler last long
- Windows connects redis installed on Linux
- F200 - UAV equipped with domestic open source flight control system based on Model Design
- Five data structures of redis
- Windows连接Linux上安装的Redis
- Virtual machine VirtualBox and vagrant installation
- Huawei 0 foundation - image sorting
- Jerry's watch deletes the existing dial file [chapter]
猜你喜欢

Maixll-Dock 摄像头使用
![[the 300th weekly match of leetcode]](/img/a7/16b491656863e2c423ff657ac6e9c5.png)
[the 300th weekly match of leetcode]
![Jerry's access to additional information on the dial [article]](/img/a1/28b2a5f7c16cbcde1625a796f0d188.jpg)
Jerry's access to additional information on the dial [article]

win10系统下插入U盘有声音提示却不显示盘符

Easy to use PDF to SVG program

Blue Bridge Cup real question: one question with clear code, master three codes

Introduction and case analysis of Prophet model

declval(指导函数返回值范例)

關於這次通信故障,我想多說幾句…

UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
随机推荐
Virtual machine VirtualBox and vagrant installation
STM32+ESP8266+MQTT协议连接OneNet物联网平台
Jielizhi obtains the currently used dial information [chapter]
d绑定函数
十、进程管理
转载:基于深度学习的工业品组件缺陷检测技术
【.NET CORE】 请求长度过长报错解决方案
Splay
Celery best practices
TOP命令详解
Jerry's setting currently uses the dial. Switch the dial through this function [chapter]
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
30 分钟看懂 PCA 主成分分析
2019阿里集群数据集使用总结
简单易用的PDF转SVG程序
JDBC驱动器、C3P0、Druid和JDBCTemplate相关依赖jar包
C language college laboratory reservation registration system
CSRF vulnerability analysis
[.Net core] solution to error reporting due to too long request length