更新 部署Redis.md
This commit is contained in:
50
部署Redis.md
Normal file
50
部署Redis.md
Normal file
@@ -0,0 +1,50 @@
|
||||
## 目录结构
|
||||
|
||||
- docker-compose.yaml
|
||||
- redis.conf
|
||||
- data/
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
services:
|
||||
redis:
|
||||
image: redis:8.6 # 替换
|
||||
container_name: redis
|
||||
ports:
|
||||
- "52358:6379" # 替换
|
||||
volumes:
|
||||
- ./redis.conf:/usr/local/etc/redis/redis.conf
|
||||
- ./data:/data
|
||||
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||
restart: on-failure:3
|
||||
```
|
||||
|
||||
## redis.conf
|
||||
|
||||
```text
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
requirepass 1965589280@Jkw!
|
||||
protected-mode no
|
||||
|
||||
dir /data
|
||||
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
dbfilename dump.rdb
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
|
||||
appendonly yes
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
|
||||
timeout 0
|
||||
tcp-keepalive 300
|
||||
loglevel notice
|
||||
databases 16
|
||||
daemonize no
|
||||
supervised no
|
||||
always-show-logo no
|
||||
```
|
||||
Reference in New Issue
Block a user