当前位置:网站首页>15_Redis_Redis.conf详解
15_Redis_Redis.conf详解
2022-07-02 12:00:00 【听*雨声】
启动的时候,就通过配置文件来启动!
单位

配置文件,units 对大小写不敏感,redis命令对字母大小写也不敏感
包含

可以将多个redis的conf组合成一个
网络配置

bind 127.0.0.1 -::1 // 绑定的端口
protected-mode yes // 保护模式
port 6379 // 端口设置
通用 :GENERAL
daemonize yes // 是否以守护进程开启,默认是no,我们需要自己开启为yes
pidfile /var/run/redis_6379.pid // 如果以后台的方式运行,我们就需要指定一个pid 文件!
Specify the server verbosity level.
This can be one of:
debug (a lot of information, useful for development/testing)
verbose (many rarely useful info, but not a mess like the debug level)
notice (moderately verbose, what you want in production probably)
warning (only very important / critical messages are logged)
loglevel notice // 日志级别
logfile “” // 日志的文件位置名。如果为空,默认标准输出
databases 16 // 数据库的数量,默认16个数据库
always-show-logo no // 是否总是显示logo,默认不显示
快照 : SNAPSHOTTING
持久化 : 在规定的时间内,执行了多少次操作,则会持久化到文件.rdb 或 .aof
redis是内存数据库,如果没有持久化,那么数据断电即失!
// 如果3600s内,如果至少有一个1 key进行了修改,我们就进行持久化操作
save 3600 1
// 如果300s内,如果至少有一个100 key进行了修改,我们就进行持久化操作
save 300 100
// 如果60s内,如果至少有一个10000 key进行了修改,我们就进行持久化操作
save 60 10000
stop-writes-on-bgsave-error yes // 持久化错误之后是否进行正常工作
rdbcompression yes // 是否压缩rdb文件,如果进行压缩会消耗CPU资源 , 默认开启
rdbchecksum yes // 保存rdb文件的时候,进行错误的检查校验!
dir ./ // rdb文件的保存目录,默认在当前路径
主从复制 : REPLICATION
安全 : SECURITY
redis默认没有密码,
使用命令设置密码

限制客户端 : CLIENTS

APPEND ONLY 模式 : aof 配置
appendonly no // 默认是不开启aof模式的,默认是使用rdb方式持久化的,在大部分所有的情况下,rdb完全够用!
appendfilename “appendonly.aof” // 持久化的文件的名字
appendfsync always // 每次修改都会sync(同步)。消耗性能
appendfsync everysec // 每秒执行一次 sync,可能会丢失这1s的数据!
appendfsync no // 不执行sync,这个时候操作系统自己同步数据,速度最快!
边栏推荐
- C thread transfer parameters
- About text selection in web pages and counting the length of selected text
- 如何用 Sysbench 测试 TiDB
- Tidb cross data center deployment topology
- LeetCode_字符串_简单_412.Fizz Buzz
- Record an error report, solve the experience, rely on repetition
- TiDB混合部署拓扑
- Solve the problem that El radio group cannot be edited after echo
- IE 浏览器正式退休
- c语言入门--数组
猜你喜欢
随机推荐
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
JMeter script parameterization
【C语音】详解指针进阶和注意点(2)
TiDB数据迁移场景综述
kibana 基础操作
CTO如何帮助业务?
为什么只会编程的程序员无法成为优秀的开发者?
Huawei interview question: no palindrome string
Learn the method code example of converting timestamp to uppercase date using PHP
Niuke Practice 101
Wechat applet uses towxml to display formula
【题解】Educational Codeforces Round 82
C RichTextBox controls the maximum number of lines displayed
Dragonfly low code security tool platform development path
Practical debugging skills
蜻蜓低代码安全工具平台开发之路
记一次报错解决经历依赖重复
C language exercises - (array)
02_线性表_顺序表
MFC 定时器使用









