当前位置:网站首页>Redis learning journey --redis Conf details
Redis learning journey --redis Conf details
2022-06-13 07:28:00 【Zhao JC】
Redis Learning journey --Redis.conf Detailed explanation
When it starts , Just start with the configuration file ! Let's take a look now Redis.conf The content of

- Company unit
The configuration file unit Company Case insensitive ! - include contain
It's like we learn Spring、Improt, include
- The Internet network
bind 127.0.0.1 # The binding of ip
protected-mode yes # Protected mode
port 6379 # Port settings
- Universal GENERAL
daemonize yes # Run 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 !
# 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) Production environment
# warning (only very important / critical messages are logged)
loglevel notice
logfile "" # The file location name of the log
databases 16 # Number of databases , The default is 16 A database
always-show-logo yes # Always show LOGO
- snapshot SNAPSHOTTING
Persistence , Within the specified time , How many operations have been performed , Will be persisted to the file .rdb. aof
redis Is a memory database , If there is no persistence , So the data power failure and loss !
# If 900s Inside , If there is at least one 1 key It's been modified , We do persistence operations
save 900 1
# If 300s Inside , If at least 10 key It's been modified , We do persistence operations
save 300 10
# If 60s Inside , If at least 10000 key It's been modified , We do persistence operations
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 working !
rdbcompression yes # Is it compressed? rdb file , It needs to be consumed cpu resources ! rdbchecksum yes # preservation rdb When you file , Check for errors !
dir ./ # rdb The directory where the files are saved !
SECURITY Security
You can set it up here redis Password , The default is no password !
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> config get requirepass # obtain Redis Password
1) "requirepass"
2) ""
127.0.0.1:6379> config set requirepass "12345678" # Set up Redis Password
OK
127.0.0.1:6379> config get requirepass # Found all commands without permission
(error) NOAUTH Authentication required.
127.0.0.1:6379> ping
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 12345678 # Log in with a password !
OK
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) "12345678"
- Master slave copy replication
- Limit CLIENTS
maxclients 10000 # Settings can be connected to redis The maximum number of clients
maxmemory <bytes> # redis Configure maximum memory capacity
maxmemory-policy noeviction # The processing strategy after the memory reaches the upper limit
1、volatile-lru: Only for key Conduct LRU( The default value is )
2、allkeys-lru : Delete lru Algorithm key
3、volatile-random: Random delete is about to expire key
4、allkeys-random: Random delete
5、volatile-ttl : Delete expiring
6、noeviction : Never expire , Returns an error
- 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. 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 !
边栏推荐
- Wechat applet - positioning, map display, route planning and navigation
- I always don't understand the high address and high position
- 对绘制丘岭密度图ridge plot的详细说明、重叠核密度估计曲线overlapping densities、FacetGrid对象、函数sns.kdeplot、函数FacetGrid.map
- 考研英语
- Login registration
- Mui mixed development - when updating the download app, the system status bar displays the download progress
- C # Advanced Programming - Feature Section
- Distributed transaction learning (I) preliminary understanding
- Issues related to C # delegation and events
- 25个国内外文献数据库
猜你喜欢
How idea breaks point debugging
RT thread simulator lvgl control: slider control
WWDC2022最大的亮点: MetalFX
Ticdc introduction
oracle问题,字段里面的数据被逗号隔开,取逗号两边数据
基于ESP32CAM实现WebSocket服务器实时点灯
关于#数据库#的问题:PGADMIN4 编辑sql窗口问题
First graphical interface
The password does not take effect after redis is set
Logback log framework learning and problems
随机推荐
25 domestic and foreign literature databases
P6154 wandering (memory search
5xx series problem solving
Station B crazy God notes
redis-2. Redis string type & bitmap
nodejs文件模块fs
领先企业的管理实践证明,企业可持续发展的核心是什么?
C Advanced Programming - features
RT-Thread 模拟器 simulator LVGL控件:button 按钮事件
RT thread simulator lvgl control: switch switch button control
How to stop PHP FPM service in php7
Deploy RDS service
DM Experiment 6: filter replication
C # related knowledge points
Detailed description of drawing ridge plot, overlapping densities of overlapping kernel density estimation curve, facetgrid object and function sns Kdeplot, function facetgrid map
汇编语言基础:寄存器和寻址方式
QT reading SQLSERVER database
Learning notes of balanced binary tree -- one two pandas
Considerations for using redis transactions
Mui mixed development - when updating the download app, the system status bar displays the download progress