1 redis configuration fileOfficial download: redis.conf Path: In the container, it can generally be saved in the Detailed explanation of the configuration file, modify it according to the actual situation: # The bind here means that only the specified network segment can access redis. If it is commented out, there is no such restriction. # bind 127.0.0.1 # The default port is 6379 port 6379 # daemonize indicates whether to execute as a daemon process. The execution in the container must be set to no # If set to yes in the container, it will conflict with -d in docker run, causing startup failure. daemonize no # protected-mode # Set to yes to enable protection mode, which means remote access is not possible. # Set to no to enable protection mode, which means remote access is possible. protected-mode no # If you comment out, the default redis password is empty. # If you enable it, redis123 will be the redis login password requirepass redis123 # databases Set the number of databases to 16 #save save 900 1 save 300 10 save 60 10000 # aof mode is not enabled by default, and RDB persistence is used by default appendonly yes # Change to yes to enable aof function appendfilename "appendonly.aof" # The name of the persistent file # appendfsync always # Each modification will be synced, which consumes performance appendfsync everysec # Execute sync once a second, and the data of 1s may be lost # appendfsync no # Do not execute sync, the operating system will automatically synchronize data 2 Docker command startStartup Command docker run -p 6379:6379 \ -v /Users/chenbinhao/redis_6379/data:/data \ -v /Users/chenbinhao/redis_6379/config/redis.conf:/etc/redis/redis.conf \ -d redis redis-server /etc/redis/redis.conf --appendonly yes Parameter Description Log view: 3 docker-compose startDirectory Structure ├─reids_6379 │ ├─docker-compose.yml │ ├─config │ │ └─redis.conf │ └─data │ │ └─.. Configure version: '3' services: redis: image: redis:latest restart: always ports: - "6379:6379" volumes: - "./data:/data" - "./config/redis.conf:/etc/redis/redis.conf" command: redis-server /etc/redis/redis.conf Startup Command Start: Execute Stop and delete: This is the end of this article about the steps to deploy redis in docker containers. For more information about deploying redis in docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: MySQL Series Database Design Three Paradigm Tutorial Examples
>>: CSS3 realizes the graphic falling animation effect
When processing batch updates of certain data, if...
Table of contents 1. Baidu Map API Access 2. Usin...
Last week, the teacher gave me a small homework, ...
Table of contents Purpose Module Installation Bas...
Preface This control will have a watermark at the...
Table of contents 1. Why is JavaScript single-thr...
Assuming you are a linuxer , we don't want to...
Table of contents 1. Regular expression creation ...
ps: The environment is as the title Install possi...
This article shares the specific code for JavaScr...
Detailed explanation of the misplacement of the in...
Recently, the project switched the environment an...
background: Tablespace: All INNODB data is stored...
Table of contents Preface call usage accomplish A...
When using TensorFlow for deep learning, insuffic...