当前位置:网站首页>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,这个时候操作系统自己同步数据,速度最快!
边栏推荐
- 【NOI模拟赛】伊莉斯elis(贪心,模拟)
- 02_线性表_顺序表
- forEach的错误用法,你都学废了吗
- 为什么只会编程的程序员无法成为优秀的开发者?
- C语言实现N皇后问题
- [C language] explain the initial and advanced levels of the pointer and points for attention (1)
- Record an error report, solve the experience, rely on repetition
- . Net core logging system
- LeetCode 2320. 统计放置房子的方式数
- Practice of compiling principle course -- implementing an interpreter or compiler of elementary function operation language
猜你喜欢
随机推荐
Apprendre le Code de la méthode de conversion du calendrier lunaire grégorien en utilisant PHP
C RichTextBox controls the maximum number of lines displayed
List集合&UML图
Learn the method code of using PHP to realize the conversion of Gregorian calendar and lunar calendar
SQL 后计算的利器 SPL
IE 浏览器正式退休
[c voice] explain the advanced pointer and points for attention (2)
02_线性表_顺序表
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
Base64 编码原来还可以这么理解
Niuke Practice 101
如何对 TiDB 进行 TPC-C 测试
Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting
表格响应式布局小技巧
04_ 栈
哈夫曼树:(1)输入各字符及其权值(2)构造哈夫曼树(3)进行哈夫曼编码(4)查找HC[i],得到各字符的哈夫曼编码
Li Chuang EDA learning notes 15: draw border or import border (DXF file)
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
华为面试题: 没有回文串
20_Redis_哨兵模式







![[noi simulation] Elis (greedy, simulation)](/img/a2/f8c8ab3bc8dd779327be3f76990976.png)

