当前位置:网站首页>Redis.conf details
Redis.conf details
2022-07-24 06:48:00 【Life goes on and battles go on】
Familiar with basic configuration
Redis The configuration file is located in Redis Installation directory , The file named redis.conf
config get * # Get all the configuration
The address of the configuration file :

We usually , One copy will be processed separately for operation . To ensure the security of the initial file
Units Company


and PHP The configuration file is similar. You can use the includes contain ,redis.conf Can be used as a master file , Other files can be included
network The network configuration
bind 127.0.0.1 # binding ip
protected-mode yes # Protected mode
port 6379 # Port settings
Universal general
daemonize yes # Run in daemon mode , The default is no We need to turn it on ourselves yes
pidfile /www/server/redis/redis.pid # If it runs in the background mode , We need to specify one pids file
# journal
# 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) Generating environment
# warning (only very important / critical messages are logged)
loglevel noticelogfile "/www/server/redis/redis.log" # Location name of the log
databases 16 # Number of databases . The default is 16 A database
always-show-logo yes # Yes, Fu always shows logo
snapshot
Persistence , Within the specified time , How many operations have been performed , Will be persisted to the file .rdb.aof
reids Is a memory database , If there is no persistence , So the data power failure and loss
# If 900 Inside If there is at least one 1 key It's been modified , We have done persistence operation
save 900 1
# If 300 Inside If there is at least one 10 key It's been modified , We have done persistence operation
save 300 10
# If 60 Inside If there is at least one 10000 key It's been modified , We have done persistence operation
save 60 10000
# We'll learn about persistence later , Will define the test itself
stop-writes-on-bgsave-error yes # Persistence if something goes wrong , Whether you need to continue workingrdbcompression yes # Is it compressed? rdb file , It needs to be consumed cpu Resources for
rdbchecksum yes # preservation rdb When you file , Check for errors
dir /www/server/redis/ #rdb The directory where the files are saved
127.0.0.1:6379> config get requirepass # obtain redis Password
1) "requirepass"
2) ""
127.0.0.1:6379> config set requirepass "123456" # Set up redis Password
OK127.0.0.1:6379> config get requirepass # Test sending requires verification
(error) NOAUTH Authentication required.127.0.0.1:6379> auth 123456 # verification
OK
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) "123456"
maxclients 10000 # Settings can be connected to redis The maximum number of client connectionsmaxmemory <bytes> # redis The maximum memory capacity of the configurationmaxmemory-policy noeviction # maxmemory-policy Processing strategy when the memory reaches the upper limit#volatile-lru: utilize LRU Algorithm to remove the set expiration time key.#volatile-random: Randomly remove the... With expiration time set key.#volatile-ttl: Remove items that are about to expire key, Delete... Based on the latest expiration time ( supplemented TTL)#allkeys-lru: utilize LRU The algorithm removes any key.#allkeys-random: Remove any... At random key.#noeviction: Do not remove any key, It just returns a write error .
appendonly no # Not on by default aof Mode , The default is to use rbd Way persistent , In most cases ,rdb It's enoughappendfilename "appendonly.aof" # The name of the persistent file# appendfsync always # Every time you make a change, it will sync Consumption performance
appendfsync everysec # Execute once per 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 , Fastest data
边栏推荐
- [lvgl (2)]
- Random forest, lgbm parameter adjustment based on Bayesian Optimization
- DHCP principle and configuration
- MGR_mysqlsh_keepalive高可用架构部署文档
- [lvgl (3)]
- Why can't index be the key of V-for?
- (static, dynamic, file) three versions of address book
- Redis basic type - combined with set
- SparkSQL核心使用,220724,
- 我有 7种 实现web实时消息推送的方案,7种!
猜你喜欢
![[lvgl (6)] display Chinese settings and make Chinese font](/img/a4/1b0d0b7a5789ecc8f9a2a8cd93d92e.png)
[lvgl (6)] display Chinese settings and make Chinese font

【音频解码芯片】VS1503音频解码芯片的应用
![[lvgl (2)]](/img/f8/d04183cf74896295382765a9dfd88d.png)
[lvgl (2)]

【微信小程序】一文搞懂条件渲染、列表渲染以及wxss模板样式

在IDEA里斗个地主不过分吧!

Secondary processing of template data

Process and planned task management
![[lvgl] API functions for setting, changing and deleting styles of components](/img/55/f25a510cf04caff7ee15e72360c3a1.png)
[lvgl] API functions for setting, changing and deleting styles of components

Getting started with redis

SSH Remote Access and control
随机推荐
Neural network superparameter adjustment (based on ray package)
LM393 电压比较器及其典型电路介绍
广度优先搜索(模板使用)
Browser local storage
Special effects - when the mouse moves, there will be a custom expression trail
Experiment: creation, expansion, and deletion of LVM logical volumes
Getting started with redis
nodejs开启多进程并实现进程间通信
STM32 MP3 music player based on FatFs r0.14b & SD card (also a simple application of FatFs)
Visibility:hidden and display:none
[lvgl (3)]
JSONObject按照key的A——Z顺序排序
Special effects - click the mouse and the randomly set text will appear
Sealos 打包部署 KubeSphere 容器平台
[small object velocimeter] only principle, no code
这些坑你不掌握,你还真不敢用BigDecimal
Multiple types of functions
Kubernetes' deployment, service concept, dynamic capacity expansion
ES10 subtotal flat and flatmap
Random forest, lgbm parameter adjustment based on Bayesian Optimization