NipGeihou's blog NipGeihou's blog
  • Java

    • 开发规范
    • 进阶笔记
    • 微服务
    • 快速开始
    • 设计模式
  • 其他

    • Golang
    • Python
    • Drat
  • Redis
  • MongoDB
  • 数据结构与算法
  • 计算机网络
  • 应用

    • Grafana
    • Prometheus
  • 容器与编排

    • KubeSphere
    • Kubernetes
    • Docker Compose
    • Docker
  • 组网

    • TailScale
    • WireGuard
  • 密码生成器
  • 英文单词生成器
🍳烹饪
🧑‍💻关于
  • 分类
  • 标签
  • 归档

NipGeihou

我见青山多妩媚,料青山见我应如是
  • Java

    • 开发规范
    • 进阶笔记
    • 微服务
    • 快速开始
    • 设计模式
  • 其他

    • Golang
    • Python
    • Drat
  • Redis
  • MongoDB
  • 数据结构与算法
  • 计算机网络
  • 应用

    • Grafana
    • Prometheus
  • 容器与编排

    • KubeSphere
    • Kubernetes
    • Docker Compose
    • Docker
  • 组网

    • TailScale
    • WireGuard
  • 密码生成器
  • 英文单词生成器
🍳烹饪
🧑‍💻关于
  • 分类
  • 标签
  • 归档
  • Linux

  • Docker

    • 基本命令
    • Docker Compose Specification快速开始
    • Docker Swarm
    • Docker容器默认时区导致MySQL时区问题错误
    • Docker - 概述
    • Docker - 基本概念
    • Docker - 自定义镜像(Dockerfile)
    • Docker Compose
    • Docker镜像仓库
    • 常用容器

      • 数据库 - MySQL
      • 内网穿透 - Frp
      • 容器面板 - Portainer
      • 消息队列 - RabbitMQ
      • Nextcloud
      • HTTP服务器 - Nginx
      • 数据库 - Redis
        • 常用命令
        • Compose
      • Samba
      • 远程工具 - RustDesk
      • 对象存储 - MinIO
      • 数据库 - TiDB
      • 数据库 - TimescaleDB
      • 带宽测试 - speedtest
      • alist
      • 数据库 - PostgreSQL
  • 云原生

  • Kubernetes

  • KubeSphere

  • K3S

  • 笔记

  • PVE

  • 维修

  • DevOps

  • 云服务

  • 路由器

  • Hyper-V

  • Windows

  • macOS

  • 运维
  • Docker
  • 常用容器
NipGeihou
2022-10-20
目录

数据库 - Redis

Docker Hub:https://hub.docker.com/_/redis (opens new window)

# 常用命令

    docker run \
    --name <容器名称> \
    -v <配置:挂载卷|宿主机路径>:/usr/local/etc/redis \
    -v <持久化:挂载卷|宿主机路径>:/data \
    -p 6379:6379 \
    -d \
    redis redis-server /usr/local/etc/redis/redis.conf
    
    docker run \
    --name my-redis \
    -v /data/redis/config:/usr/local/etc/redis \
    -v /data/redis/data:/data \
    -p 6379:6379 \
    -d \
    redis redis-server /usr/local/etc/redis/redis.conf
    
    // Make sure to add code blocks to your code group

    配置: <配置:挂载卷|宿主机路径>/redis.conf ,需提前创建好!

    redis.conf 参考配置:官方配置文档 (opens new window)

    appendonly yes
    requirepass <访问密码>
    

    # Compose

    services:
      redis:
        image: redis
        container_name: my-redis
        volumes:
          - /data/redis/config:/usr/local/etc/redis
          - /data/redis/data:/data
        ports:
          - "6379:6379"
        command: redis-server /usr/local/etc/redis/redis.conf
    
    上次更新: 2024/08/25, 02:09:30
    HTTP服务器 - Nginx
    Samba

    ← HTTP服务器 - Nginx Samba→

    最近更新
    01
    iSCSI服务搭建
    05-10
    02
    磁盘管理与文件系统
    05-02
    03
    网络测试 - iperf3
    05-02
    更多文章>
    Theme by Vdoing | Copyright © 2018-2025 NipGeihou | 友情链接
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式