当前位置:网站首页>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,这个时候操作系统自己同步数据,速度最快!
边栏推荐
- LeetCode 209. 长度最小的子数组
- Sharp tool SPL for post SQL calculation
- forEach的错误用法,你都学废了吗
- Kibana basic operation
- 18_Redis_Redis主从复制&&集群搭建
- Record an interview
- 用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下
- IE 浏览器正式退休
- 871. Minimum refueling times: simple priority queue (heap) greedy question
- 哈夫曼树:(1)输入各字符及其权值(2)构造哈夫曼树(3)进行哈夫曼编码(4)查找HC[i],得到各字符的哈夫曼编码
猜你喜欢

C#代码审计实战+前置知识

为什么只会编程的程序员无法成为优秀的开发者?

. Net core logging system

It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen

C code audit practice + pre knowledge

04_ 栈

Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly

XML配置文件

MFC 定时器使用
![[untitled] leetcode 2321 Maximum score of concatenated array](/img/a3/54d0e83f02ef0d0d8d269351c35b39.png)
[untitled] leetcode 2321 Maximum score of concatenated array
随机推荐
实用调试技巧
C语言实现N皇后问题
Ad20 cannot select the solution of component packaging in PCB editor
Why can't programmers who can only program become excellent developers?
How to write sensor data into computer database
记一次面试
C语言习题---(数组)
Huawei interview question: no palindrome string
[C language] explain the initial and advanced levels of the pointer and points for attention (1)
Learn the method code example of converting timestamp to uppercase date using PHP
Record an error report, solve the experience, rely on repetition
Tidb data migration scenario overview
Application and practice of Jenkins pipeline
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
How to solve the problem of database content output
关于网页中的文本选择以及统计选中文本长度
如何对 TiDB 进行 TPC-C 测试
Mfc a dialog calls B dialog function and passes parameters
TiDB跨数据中心部署拓扑
用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下