当前位置:网站首页>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语言实现N皇后问题
- CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
- Introduction to C language -- array
- 数据分析常见的英文缩写(一)
- 【题解】Educational Codeforces Round 82
- TiDB混合部署拓扑
- [C language] explain the initial and advanced levels of the pointer and points for attention (1)
- 关于网页中的文本选择以及统计选中文本长度
- PHP method to get the index value of the array item with the largest key value in the array
- Mfc a dialog calls B dialog function and passes parameters
猜你喜欢
随机推荐
MFC CString to char*
LeetCode 209. 长度最小的子数组
C thread transfer parameters
871. 最低加油次数 : 简单优先队列(堆)贪心题
Have you learned the wrong usage of foreach
华为面试题: 没有回文串
Some Chinese character codes in the user privacy agreement are not standardized, which leads to the display of garbled codes on the web page. It needs to be found and handled uniformly
Record an interview
Map介绍
学习使用php实现公历农历转换的方法代码
广州市应急管理局发布7月高温高湿化工安全提醒
Key points of compilation principle examination in 2021-2022 academic year [overseas Chinese University]
如何对 TiDB 进行 TPC-C 测试
[untitled] leetcode 2321 Maximum score of concatenated array
为什么只会编程的程序员无法成为优秀的开发者?
SQL 后计算的利器 SPL
LeetCode 2320. Count the number of ways to place the house
Printf function and scanf function in C language
LeetCode 2310. The number of digits is the sum of integers of K
Tidb environment and system configuration check








