当前位置:网站首页>15_ Redis_ Redis. Conf detailed explanation
15_ Redis_ Redis. Conf detailed explanation
2022-07-02 15:20:00 【Listen to the rain】
When it starts , Just start with the configuration file !
Company
The configuration file ,units Case insensitive ,redis Commands are not case sensitive
contain
Multiple redis Of conf Combine into one
The network configuration
bind 127.0.0.1 -::1 // Bound port
protected-mode yes // Protected mode
port 6379 // Port settings
Universal :GENERAL
daemonize yes // Whether to start as a daemon , The default is no, We need to turn it on ourselves yes
pidfile /var/run/redis_6379.pid // If it runs in the background mode , We need to specify one pid file !
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 // The level of logging
logfile “” // The file location name of the log . If it is empty , Default standard output
databases 16 // Number of databases , Default 16 A database
always-show-logo no // Always show logo, Default not to show
snapshot : SNAPSHOTTING
Persistence : Within the specified time , How many operations have been performed , Will be persisted to the file .rdb or .aof
redis Is a memory database , If there is no persistence , If the data is powered off, it will be lost !
// If 3600s Inside , If there is at least one 1 key It's been modified , Let's do persistence
save 3600 1
// If 300s Inside , If there is at least one 100 key It's been modified , Let's do persistence
save 300 100
// If 60s Inside , If there is at least one 10000 key It's been modified , Let's do persistence
save 60 10000
stop-writes-on-bgsave-error yes // Whether the persistence error works properly
rdbcompression yes // Is it compressed? rdb file , Compression will consume CPU resources , Default on
rdbchecksum yes // preservation rdb When you file , Check for errors !
dir ./ // rdb File storage directory , Default to current path
Master slave copy : REPLICATION
Security : SECURITY
redis No password by default ,
Set password with command
Restrict client : CLIENTS
APPEND ONLY Pattern : aof To configure
appendonly no // The default is not on aof Mode , The default is to use rdb Way persistent , In most cases ,rdb Quite enough !
appendfilename “appendonly.aof” // The name of the persistent file
appendfsync always // Every time you make a change, it will sync( Sync ). Consumption performance
appendfsync everysec // Once a second sync, You may lose this 1s The data of !
appendfsync no // Don't execute sync, At this time, the operating system synchronizes its own data , The fastest !
边栏推荐
- How to solve the problem of database content output
- 原则、语言、编译、解释
- Niuke Practice 101
- Huffman tree: (1) input each character and its weight (2) construct Huffman tree (3) carry out Huffman coding (4) find hc[i], and get the Huffman coding of each character
- Solve the problem that El radio group cannot be edited after echo
- Principles, language, compilation, interpretation
- PHP method to get the index value of the array item with the largest key value in the array
- 11_Redis_Hyperloglog_命令
- php获取数组中键值最大数组项的索引值的方法
- C# richTextBox控制显示最大行数
猜你喜欢
随机推荐
HUSTPC2022
15_Redis_Redis.conf详解
传感器数据怎么写入电脑数据库
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
Map introduction
解决el-radio-group 回显后不能编辑问题
数据分析常见的英文缩写(一)
Base64 coding can be understood this way
C语言中的算术运算及相关练习题
Application of CDN in game field
.NET Core 日志系统
Solve the problem that El radio group cannot be edited after echo
Dragonfly low code security tool platform development path
Why can't programmers who can only program become excellent developers?
php获取数组中键值最大数组项的索引值的方法
Huawei interview question: no palindrome string
MFC CString 转 char*
[noi simulation] Elis (greedy, simulation)
编译原理课程实践——实现一个初等函数运算语言的解释器或编译器
[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)