企业网站建设的类型有哪些,网站建设好推荐,站长统计app软件,广州网站建设选哪家1. 创建挂载文件目录
mkdir -p /home/redis/config
mkdir -p /home/redis/data
# 创建配置文件#xff1a;docker容器中默认不包含配置文件
touch /home/redis/config/redis.conf2. 书写配置文件
# Redis 服务器配置# 绑定的 IP 地址#xff0c;默认为本地回环地址 127.0.0…1. 创建挂载文件目录
mkdir -p /home/redis/config
mkdir -p /home/redis/data
# 创建配置文件docker容器中默认不包含配置文件
touch /home/redis/config/redis.conf2. 书写配置文件
# Redis 服务器配置# 绑定的 IP 地址默认为本地回环地址 127.0.0.1
# 外网访问需注释掉此行
# bind 127.0.0.1# 监听的端口默认为 6379
port 6379# 设置密码
requirepass youpassword# 启用 AOF 持久化模式
appendonly yes# 持久化方式。可选项always, everysec, no
appendfsync everysec# AOF 文件名称默认为 appendonly.aof
appendfilename appendonly.aof# AOF 自动重写触发条件
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb# 设置最大内存限制单位字节
maxmemory 2gb# 内存淘汰策略。可选项volatile-lru, allkeys-lru, volatile-random, allkeys-random, volatile-ttl, noeviction
maxmemory-policy allkeys-lru3. 拉取镜像文件
docker pull redis:7.0.24. 启动容器
docker run -p 6379:6379 \
--name redis \
-v /home/redis/config/redis.conf:/etc/redis/redis.conf \
-v /home/redis/data:/data \
-d redis:7.0.2 redis-server \
/etc/redis/redis.conf --appendonly yes