当前位置:网站首页>Redis database, which can be understood by zero foundation Xiaobai, is easy to learn and use!
Redis database, which can be understood by zero foundation Xiaobai, is easy to learn and use!
2022-07-27 04:04:00 【Wu_ Candy】
Preface
Redis(Remote Dictionary Server ), Remote dictionary service , Is an open source use ANSI C Language writing 、 Support network 、 Log type that can be memory based or persistent 、Key-Value database , And provide multilingual API.
Redis Is a high-performance key-value database . To ensure efficiency , The data is cached in memory .
Redis Periodically, updated data is written to disk or changes are written to an appended log file , And on this basis to achieve master-slave( Master-slave ) Sync .
—— Excerpt from : Baidu Encyclopedia
Installation steps
1. Download the source code
# Carry out orders :
wget http://download.redis.io/releases/redis-7.0.3.tar.gz
2. Decompress the source code
# Carry out orders :
tar -zxvf redis-7.0.3.tar.gz
3. Go to unzip directory
# Carry out orders :
cd redis-7.0.3
4. compile Redis
# Carry out orders :
make install
Be careful :
make After the command is executed and compiled , Will be in src Generate under directory 6 Executable files , Namely :
- redis-server
- redis-cli
- redis-benchmark
- redis-check-aof
- redis-check-rdb
- redis-sentinel
5. take redis-server Put it in the specified directory
After compilation redis-server I put the file locally /Users/tools/redis-7.0.3/src In the catalog
Because in utils In the catalog redis_init_script Configured in the file redis-server The path is :/usr/local/bin/redis-server

Use the following command to redis-server Copy to the specified directory
cp /Users/tools/redis-7.0.3/src/redis-server /usr/local/bin
View version
1. see redis-server edition
redis-server --version

The above prompt message indicates that the configuration is successful
2. see redis-cli edition
redis-cli --version

The above prompt message indicates that the configuration is successful
start-up Redis The server
1. Start command
(1).redis-server --requirepass 123456 --port 1234 > redis.log &
(2).redis-server Profile path > redis.log &
2. Parameter interpretation
--requirepass 123456: Add connection authentication password 123456
--port 1234: Start the service at 1234 port , Do not use the default port 6379
> redis.log: Write the startup log redis.log In file , Do not output directly to the current screen
&: Put the service in the background
3. View running processes
jobs |grep Running

4. Be careful
Specify the port number or use the default port number 6379 front , First use netstat -a |grep 6379 Command to check whether the port is occupied , It can only be used if it is not occupied
When the use port is occupied , Start up redis-server During service, the log will give the following error prompt , Here we use 6379 The port is occupied as an example

start-up Redis client
# Connect locally initiated redis service
(1).redis-cli
(2).redis-cli -h host IP Address -p port

Start up redis-server The service , The order I used was :redis-server --requirepass 123456 > redis.log &
So when connecting redis Authentication password is required for service , Use command :auth 123456 Carriage return certification , If the password authentication is successful OK A hint of , As shown in the above figure redis Service connection successful
1. Store key value pairs
# Carry out orders :
set username candy
2. Read Key
# Carry out orders :
get username

3. Set timeout
# Deposit key:username,value:Tony The key value pair of is valid for 30 second
set username Tony ex 30
4. Check the key value lifetime
# Carry out orders :username- Key value
ttl username

The content shared today is quite basic , Be friendly to novices or little friends with little experience , We will continue to update about Redis Related articles of
Welcome to your attention The way of immeasurable testing official account , reply Claim resources
Python+Unittest frame API automation 、
Python+Unittest frame API automation 、
Python+Pytest frame API automation 、
Python+Pandas+Pyecharts Big data analysis 、
Python+Selenium frame Web Of UI automation 、
Python+Appium frame APP Of UI automation 、
Python Programming learning resources dry goods 、
Vue Front end component framework development 、
Resources and code Free ~
Below the official account is two-dimensional code. , You can directly scan wechat and pay attention .
remarks : My official account has been officially opened. , betake IT Sharing of Internet technology .
contain : Data analysis 、 big data 、 machine learning 、 Test Development 、API Interface automation 、 Test operation and maintenance 、UI automation 、 Performance testing 、 code detection 、 Programming technology, etc .
WeChat search official account : The way of immeasurable testing
Add the attention , Let's grow together !
边栏推荐
- It's confirmed that the registration of soft exam in the second half of 2022 will start in August
- Chapter 5 决策树和随机森林实践
- A. Parkway Walk
- Alibaba cloud server domain name and port web page cannot access the problem record
- Skywalking distributed system application performance monitoring tool - medium
- 288页18万字智能化校园总体设计 目录
- URDF_ Xcaro
- Plato farm brings a new experience to community users through the LAAS protocol elephant swap
- Implementation of API short message gateway based on golang
- 04. Detailed steps for installing the simulated browser chromedriver in Google browser
猜你喜欢

JMeter interface test (login, registration)

Feitengtengrui d2000 won the "top ten hard core technologies" award of Digital China

Characteristics and experimental suggestions of abbkine abfluor 488 cell apoptosis detection kit

次轮Okaleido Tiger即将登录Binance NFT,引发社区热议

Director of meta quest content ecology talks about the original intention of APP lab design

Principle understanding and application of hash table and consistent hash

Do you really understand code rollback?

The fifth strong network cup national network security challenge Title reappearance (with title attachment, detailed explanation)

Installation and use of anti-virus software ClamAV

科目三: 济南章丘五号线
随机推荐
想要获得 Apache 官方域名邮箱吗?专访 Apache Linkis 五位新晋 Committer告诉你怎么做
Six determination methods of Worthington peroxidase activity
Plato Farm有望通过Elephant Swap,进一步向外拓展生态
leetcode:433. 最小基因变化
Detailed tutorial of typera
H.265网页播放器EasyPlayer对外开放录像的方法
Day 28 of leetcode
C language introduction practice (12): find the value of natural constant e
Binary tree (Beijing University of Posts and Telecommunications machine test questions) (day85)
Plato farm brings a new experience to community users through the LAAS protocol elephant swap
Process analysis of object creation
Have you encountered the situation that CDC reads incomplete MySQL fields? How to deal with it?
安装umi4阻碍一天的问题解决了
[Yugong series] July 2022 go teaching course 018 switch of branch structure
Parallels Desktop启动虚拟机“操作失败”问题解决
深圳家具展首日,金可儿展位三大看点全解锁!
Program to change the priority of the process in LabVIEW
Chapter 5 decision tree and random forest practice
科目三: 济南章丘二号线
基于风能转换系统的非线性优化跟踪控制(Matlab代码实现)