当前位置:网站首页>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 language] explain the initial and advanced levels of the pointer and points for attention (1)
- .NET Core 日志系统
- SQL 后计算的利器 SPL
- C语言实现N皇后问题
- TiDB数据迁移场景综述
- 可视化搭建页面工具的前世今生
- C语言中的printf函数和scanf函数
- Learn the method code example of converting timestamp to uppercase date using PHP
- Dragonfly low code security tool platform development path
- Ad20 cannot select the solution of component packaging in PCB editor
猜你喜欢

CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E

Why can't programmers who can only program become excellent developers?

C language exercises - (array)
![[noi Simulation Competition] scraping (dynamic planning)](/img/ee/27a07f80207a2925f5065e633eb39f.png)
[noi Simulation Competition] scraping (dynamic planning)

How does CTO help the business?
![[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)](/img/7b/2c471c070a3faa981f70136603495a.jpg)
[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)

C语言习题---(数组)

解决el-radio-group 回显后不能编辑问题

GeoServer offline map service construction and layer Publishing

vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
随机推荐
Recommended configuration of tidb software and hardware environment
Add vector formula in rich text editor (MathType for TinyMCE, visual addition)
你不知道的Set集合
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
C语言中的算术运算及相关练习题
18_Redis_Redis主从复制&&集群搭建
【NOI模拟赛】刮痧(动态规划)
TiDB数据迁移场景综述
C语言中的printf函数和scanf函数
Learn the method code example of converting timestamp to uppercase date using PHP
如何用 Sysbench 测试 TiDB
[untitled] leetcode 2321 Maximum score of concatenated array
kibana 基础操作
Introduction to mathjax (web display of mathematical formulas, vector)
蜻蜓低代码安全工具平台开发之路
Apprendre le Code de la méthode de conversion du calendrier lunaire grégorien en utilisant PHP
871. Minimum refueling times: simple priority queue (heap) greedy question
哈夫曼树:(1)输入各字符及其权值(2)构造哈夫曼树(3)进行哈夫曼编码(4)查找HC[i],得到各字符的哈夫曼编码
Tidb data migration tool overview
Points clés de l'examen de principe de compilation pour l'année scolaire 2021 - 2022 [Université chinoise d'outre - mer]