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

相关推荐
虎头金猫17 小时前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
分布式存储与RustFS18 小时前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
IT大白鼠19 小时前
Redis 系列 · 第 01 篇——认知入门:Redis 是什么
redis·nosql
彧azz19 小时前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
玉&心20 小时前
通过Arthas在线诊断K8S中的内存及JVM等使用情况
docker·k8s·arthas
xing-xing20 小时前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
赵文宇(温玉)20 小时前
CoreDNS的hosts插件的缺行配置导致k8s集群异常
容器·kubernetes·rancher
guo_wen_qiang20 小时前
上传本地镜像到harbor中
docker·容器·持续部署
羑悻的小杀马特21 小时前
Dockerfile 全景指南:从入门编写dockerfile到生产环境镜像优化实战,一步步带你从啃透制作指令到镜像制作落地!
docker·dockerfile·镜像制作
BianHuanShiZhe21 小时前
docker常见命令
docker