Redis初步学习整理——第五节Redis配置文件、RDB、AOF、Redis订阅发布

本文详细介绍了Redis的配置文件、持久化机制RDB和AOF,以及Redis的订阅发布功能。RDB通过快照保存数据,适合全量备份,AOF记录操作日志,避免数据丢失。同时,文章探讨了RDB的save、bgsave命令和自动化保存机制,以及AOF的重写过程。最后,简要概述了Redis的订阅发布功能。
摘要由CSDN通过智能技术生成

前言

上几节学习完了Redis的常规操作,这节就深入学习一下Redis的配置文件、RDB、AOF、Redis订阅发布内容了,共同加油!

一、redis.conf 配置文件参数

Redis配置文件涉及到的参数很多,如果英文很好的话,配置文件中都有相应的案例,所以不难理解,但是对于我这种英语起步阶段的话,还是需要对一些重点的参数进行一下整理的

# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.
# 这个提示了在配置文件中的单位
################################## INCLUDES ###################################

# Include one or more other config files here.  This is useful if you
# have a standard template that goes to all Redis servers but also need
# to customize a few per-server settings.  Include files can include
# other files, so use this wisely.
#
# Note that option "include" won't be rewritten by command "CONFIG REWRITE"
# from admin or Redis Sentinel. Since Redis always uses the last processed
# line as value of a configuration directive, you'd better put includes
# at the beginning of this file to avoid overwriting config change at runtime.
#
# If instead you are interested in using includes to override configuration
# options, it is better to use include as the last line.
#
# include /path/to/local.conf
# include /path/to/other.conf
# 提示了如何引入其他的配置文件
# 网络
bind * # 绑定可以访问的主机ip,默认是bind 127.0.0.1,只有本机可以访问
protected-mode no # 是否开启保护模式,通常和bind配合使用
port 6379  # 设置端口号
# 通用配置
daemonize yes # 是否后台启动redis,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值