当前位置:网站首页>Redis learning notes (continuously updating)
Redis learning notes (continuously updating)
2022-06-12 04:34:00 【Python's path to becoming a God】
Redis
One 、Redis Installation and overview
1.1、 summary
Redis What is it? ?
Redis(Remote Dictionary Server ), Remote dictionary service ,
Redis It's an open source key-value The storage system , The hottest thing right now NoSQL One of the technologies .
1.2、 install
1. hold redis-6.2.6.tar.gz Upload to /opt Folder
2. Check to see if there is gcc Compile environment gcc --version
If not, install yum install gcc
3. decompression redis-6.2.6.tar.gz file tar -zxvf redis-6.2.6.tar.gz
After decompression, go to redis-6.2.6 Folder cd redis-6.2.6
Input does not contain parameters make Command to compile make
install redis make install
1.3 Check the installation directory
1.3.1、 The default directory :/usr/local
1.redis-benchmark: Performance testing tools , You can run it in your own notebook to see how it performs
2.redis-check-aof: Recover the problem AOF file
3.redis-check-dump: Recover the problem dump.rdb file
4.redis-sentinel:Redis Cluster use
5.redis-server:Redis Server start command
6.redis-cli: client , Operation entrance
1.3.2、 Background start Redis
1、 Get into /opt, View directory , hold redis.conf Copied to the /etc The file named redis.conf
2、 Background settings daemonize no Change to yes
3、redis start-up Start command :redis-server /etc/redis.conf
4、 View server processes :ps -ef | grep redis
5、 Through the client link Redis command :redis-cli
6、 close Redis:
- shutdown
- exit
- kill -9 3837
1.3.3、 Test performance
redis-benchmark It's a stress testing tool !
redis-benchmark Command parameter
redis-benchmark [option] [option value]

Just test it :
# test :100 Two concurrent connections 100000 A request
redis-benchmark -h localhost -p 6379 -c 100 -n 100000
Two 、Redis key (key)
- keys * : View all in the current library key
- set key value : Add... To the current library key and value
- exists key : Judge a certain key Whether there is
- type key : View specified key Data type of
- del key : Delete specified key data
- unlink key: according to value Select non blocking delete
Tight grip keys from keyspace Delete from metadata , The real deletion will occur in the subsequent asynchronous operations
- expire key 10:10 Seconds is key Set expiration time
- MOVE key db Will be the current database of key Move to a given database db among .
- move name 1 Remove the current key
- PERSIST key remove key The expiration time of ,key Will last .
- RANDOMKEY Returns a random... From the current database key .
- RENAME key newkey modify key The name of
- TYPE key return key The type of value stored .
- ttl key See how many seconds are left to expire ,-1 Never expire ,-2 Indicates that it has expired
- select Command switch database
- dbsize: Check the... Of the current database key The number of
- flushdb: Empty the current library
- flushall: Kill all the warehouses
边栏推荐
- [C language] analysis of variable essence
- Is there a row limit for a single MySQL table
- 1. Mx6ull learning notes (III) - busybox creates root file system
- WPF 数据绑定(四)
- Exception handling and unit testing
- Manually encapsulate a foreacht and map
- [C language] encapsulation interface (addition, subtraction, multiplication and division)
- D1 Nezha development board power on record
- L1-068 harmonic average (10 points)
- SQL注入上传一句话木马(转)
猜你喜欢

D1 Nezha development board power on record

JWT学习与使用

Mysql主从搭建与Django实现读写分离

Brief introduction to 44 official cases of vrtk3.3 (combined with steamvr)

2022 fusion welding and thermal cutting recurrent training question bank and simulation examination

Memory protection

Bearpi IOT serial port transceiver 1- normal mode
![Epidemic data analysis platform work report [2] interface API](/img/63/383d52775790920bd2467d7ecacfe5.png)
Epidemic data analysis platform work report [2] interface API

Illustrating the use of Apache skywalking UI

SQL注入上传一句话木马(转)
随机推荐
Operation of simulated examination platform for theoretical question bank of G2 utility boiler stoker in 2022
WPF data binding (IV)
[efficient] the most powerful development tool, ctool, is a compilation tool
MFC General dialog color dialog
[fpga+gps receiver] detailed design introduction of dual frequency GPS receiver based on FPGA
疫情数据分析平台工作报告【4】跨域相关
La mise en évidence de la recherche par blocs est - elle prise en charge dans les versions ultérieures?
Oracle's instr()
kali_ Nat mode, bridging Internet / host only_ detailed
The memory four area model of C language program
Jwt Learning and use
SqEL简单上手
2.28 (defect filling) data type conversion exception handling part multi threading
Tasks in C #
调用提醒事项
Smart Panel wifi Linkage Technology, esp32 wireless chip module, Internet of Things WiFi Communication Application
Gavin teacher's perception of transformer live class - rasa dialogue robot project practice in the field of education agency mode and core component source code analysis under the microservice of educ
Things to challenge
Why should a redis cluster use a reverse proxy? Just read this one
MySQL master-slave construction and Django implementation of read-write separation