当前位置:网站首页>Conf configuration of redis
Conf configuration of redis
2022-07-22 15:13:00 【Just number six Z】
Redis Of conf To configure
Redis Of conf To configure
redis start-up , It is started through the configuration file .
1. Company
Company : Configuration file for unit Unit case insensitive .
2. contain
contain : You can configure multiple configuration files at the same time .
3. The network configuration :
bind 127.0.0.1 The binding of ip
protected-mode yes Protected mode
port 6379 Port number
4. General configuration :
daemon yes Run as a background 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 debug、verbose( Be similar to debug)、notice( Production environment )、warning
loglevel notice Configure log level
logfile .. Location of log files
database 16 The default number of databases
always-show-log yes Whether to display the opening page log
5. Snapshot configuration
Persistence , In a given time , How many operations have been performed , Will be persisted to the file (.rdb .aof)
If 900s Inside , At least one key It's been modified , Then perform the persistence operation
save 900 1
If 300s Inside , At least ten key It's been modified , Then perform the persistence operation
save 300 10
If 60s Inside , At least a thousand key It's been modified , Then perform the persistence operation
save 60 10000
We learned about persistence later , We will customize this
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 current directory where the file is saved
6.replication Copy
Master slave copy explanation
replicaof <masterip> <masterport> Configure the host
7. Security configuration
obtain redis password No password by default
127.0.0.1:6379> config get requirepass
"requirepass"
""
Set the password
(1) Add directly in the configuration file requirepass 123
(2) Configure by command
127.0.0.1:6379> config set requirepass "123"
Sign in
127.0.0.1:6379>auth 123
8. Limit clients
maxclients 10000 Settings can be connected to redis The maximum number of clients is 10000
maxmemory <bytes> redis Configure the maximum content capacity
mavmemory-policy noeviction The processing strategy after the content reaches the upper limit
1.volatile-lru: Only set the expiration time key Conduct lru( The default value is )
2.allkeys-lru: Delete lru Algorithm key
3.volatile-random: Delete the expiring key
4.allkeyo-random: Random delete
5.volatile-ttl: Delete expiring
6.noeviction: Never expire , Returns an error
9.append only Pattern aof Configuration of
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 everysec Once a second sync You may lose this 1s The data of
always It changes every time sync Consumption performance
no Don't execute sync At this time, the operating system synchronizes its own data , The fastest
边栏推荐
- 1338. Halve the size of the array ●●
- PMP Exam agile proportion soared, how to prepare for the exam?
- 2022-07-15 mysql/stonedb子查询性能分析-FindOneInsidePack
- 矽穀課堂筆記(下)
- Redis持久化(RDB和AOF)
- Various application schemes of animal free collagenase Worthington
- 分布式链路追踪-skywalking基础
- 入门推荐系统必读的10篇baseline paper
- 怎样可以让导电滑环的信号更好
- 某视频app分析样本
猜你喜欢
随机推荐
2022-07-17 flex/yacc syntax exercise for MySQL
NAT技术
AOSP ~ camera - rk hal3 (I)
入门推荐系统必读的10篇baseline paper
2022-07-18 jenkins部署
某东分析样本
322. Change exchange ●●
How to make the signal of conductive slip ring better
Time of regular release under test
Redis的拓展方案
2022-07-20 MySQL hashjoin description
2022-07-12 use perf to count the performance of MySQL execution
ADS多频功放偏置网络设计
How to prolong the working life of slip ring
滑环的分类以及用途
With no performance forecast, BOE is silent at this time?
1234556666
2022 - 07 - 18 sous - Requête - optimisation du traitement de l'optimiseur de requête join pour le scénario exists
【独立站运营】Shopify卖家:如何改善店铺体验?两招搞定!
2022-07-15 mysql接收新连接处理