docker-compose安装Redis

  • redis.conf

    conf 复制代码
    acllog-max-len 128
    
    requirepass 密码
    
    lazyfree-lazy-eviction no
    lazyfree-lazy-expire no
    lazyfree-lazy-server-del no
    replica-lazy-flush no
    
    lazyfree-lazy-user-del no
    
    lazyfree-lazy-user-flush no
    
    oom-score-adj no
    
    oom-score-adj-values 0 200 800
    
    disable-thp yes
    
    appendonly no
    
    appendfilename "appendonly.aof"
    
    appendfsync everysec
    
    no-appendfsync-on-rewrite no
    
    auto-aof-rewrite-percentage 100
    auto-aof-rewrite-min-size 64mb
    
    aof-load-truncated yes
    
    aof-use-rdb-preamble yes
    
    lua-time-limit 5000
    
    slowlog-log-slower-than 10000
    
    slowlog-max-len 128
    
    latency-monitor-threshold 0
    
    notify-keyspace-events ""
    
    hash-max-ziplist-entries 512
    hash-max-ziplist-value 64
    
    list-max-ziplist-size -2
    
    list-compress-depth 0
    
    set-max-intset-entries 512
    
    zset-max-ziplist-entries 128
    zset-max-ziplist-value 64
  • docker-compose.yml

    yml 复制代码
    version: '3'
    services:
      redis:
        image: redis:8.4.0
        container_name: redis_all
        ports:
          - 6379:6379
        volumes:
          - ./redis.conf:/etc/redis/redis.conf
          - ./data:/data
        restart: always
        privileged: true # 获取宿主机root权限
        command: ["redis-server","/etc/redis/redis.conf"] # 指定配置文件启动redis-server进程
  • docker compose up -d

相关推荐
杨浦老苏3 小时前
开源多用户图书追踪系统LibrisLog
docker·群晖·收藏管理
cfm_29143 小时前
Redis五大基本数据结构底层了解
数据结构·数据库·redis
真实的菜4 小时前
Redis 从入门到精通(十二):典型业务场景实战 —— 排行榜、限流器、秒杀系统、Session 共享
数据库·redis·python
赵渝强老师5 小时前
【赵渝强老师】Kubernetes(K8s)中的金丝雀升级
linux·docker·云原生·容器·kubernetes
鹤落晴春5 小时前
【K8s】配置存储卷
云原生·容器·kubernetes
我叫张小白。6 小时前
CentOS 7 安装 Docker并配置镜像加速(完整指南)
linux·docker·centos
原来是猿7 小时前
Docker 【 技术架构(1)】
docker·容器·架构
ba_pi8 小时前
k8s删除pod
linux·容器·kubernetes
木雷坞8 小时前
Qdrant Docker 部署教程:数据卷、API Key 和集合初始化
运维·docker·容器·知识图谱
梦梦代码精8 小时前
为什么这个开源的AI平台会火?有点东西。。。
人工智能·算法·机器学习·docker·开源