当前位置:网站首页>Detailed tutorial on installing redis on Linux
Detailed tutorial on installing redis on Linux
2022-07-26 19:17:00 【Strange [email protected]】
Catalog
Official website tutorial :https://redis.io/docs/getting-started/installation/install-redis-from-source/
One 、 download Redis
This allows you to view redis The latest version :https://github.com/redis/redis-hashes
From you to Redis Download the website to get the latest stable version Redis The source file , Please run :
wget https://download.redis.io/redis-stable.tar.gz
Two 、 Decompression and compilation
To compile Redis, First of all tar decompression , Switch to the root directory , And then run make:
tar -xzvf redis-stable.tar.gz
cd redis-stable
make
If the compilation is successful , Will you be in src Found several in the directory Redis Binary , Include :
- redis-server:Redis The server itself
- redis-cli: Is with the Redis Dialog command line interface utility .
3、 ... and 、 Install binaries
Please run :
cd redis-stable
yum install gcc-c++
make install
The default installation path is :/usr/local/bin

After installation , You can start by running Redis
redis-server

Although it started at this time , But only local clients can connect , And it's not running in the background , When we close the startup interface, we can't connect , So you need to modify some configurations !
Four 、 Modify the configuration file
1. The first step is , Copy one redis.conf File to user/local/bin Under the table of contents , Here I have created a new folder for storing config, Copy here is for startup , We can specify this configuration file to start .
It can also be understood as : To build a pseudo cluster redis To prepare for , Is through a machine , Start multiple machines at the same time redis. If you don't plan to build a pseudo cluster redis, This step is completely unnecessary .

2. Modify the configuration file
I copied the configuration file to user/local/bin Under the table of contents , Without setting up a pseudo cluster , Normally we modify /opt/redis-stable/ Under the config Configuration file , You will find it here by default when starting .
(1) modify peotected-mode
modify peotected-mode yes
Change it to :protected-mode no.
#protected-mode Parameter is used to disable Internet access redis, If enabled , Only through localhost ip (127.0.0.1) visit Redis

(2) close bind 127.0.0.1
Comment out bind 127.0.0.1, Or modify bind 0.0.0.0, To allow all ip Address access

(3)redis It is not started in the background by default , modify daemonize by no

5、 ... and 、 start-up Redis
1. Start by specifying a configuration file redis

2. Use redis-cli Client connection test

3. see redis Whether the process of
One of the processes is server The process of , One is cli The process of , When the client returns , The process disappears .

4. close Redis service
/usr/bin/redis-cli shutdown # close redis service
Or enter the client to execute shutdown close 
Check again to see if the process exists

5. see redis edition

6、 ... and 、 Test performance
redis-benchmark It's a stress testing tool !
Official performance testing tool !

redis The basic commands for performance testing are as follows :
redis-benchmark [option] [option value]
[option] [option value]: for example (key value In the form of ):
redis-benchmark -n 10000
The following figure is provided by rookies , because redis Constantly updating , The default values in the figure below may not be up-to-date .

Let's simply test :
The host to 127.0.0.1, The port number is 6379, The order to be executed is set,get, The number of requests is 100000,100 Two concurrent connections , adopt -q Parameter makes the result show only the number of requests executed per second .
redis-benchmark -h localhost -p 6379 -t set,get -c 100 -n 100000 -q

If not -q:

版权声明
本文为[Strange [email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/200/202207181409350619.html
边栏推荐
- Microsoft silently donated $10000 to curl, which was not notified until half a year later
- OpenSSF 基金会总经理 Brian Behlendorf :预计 2026 年将有 4.2 亿个开源
- VTK (the Visualization Toolkit) loads STL models
- JS刷题计划——数组
- [AUTOSAR RTE] - 1-talk about RTE (run time environment)
- MySQL学习笔记-2.如何提高sql语句的查询性能
- Typescript stage learning
- 手机申请公募reits账户安全吗?
- How far can Volvo, which has lost its "safety brand" due to declining sales and marginalization of its brand?
- EN 1504-7混凝土结构保护和修理用产品钢筋防腐—CE认证
猜你喜欢

2022 chemical automation control instrument test question simulation test platform operation
![[postgraduate entrance examination vocabulary training camp] day 13 - reliance, expert, subject, unconscious, photograph, exaggeration, counter act](/img/9c/0e6e8abebfd3afdeef2913281a6ada.png)
[postgraduate entrance examination vocabulary training camp] day 13 - reliance, expert, subject, unconscious, photograph, exaggeration, counter act

Network protocol: tcp/ip protocol

Vs2019 export import configuration

C语言-入门-语法-字符串(十一)

Some time series modeling strategies (I)

数据湖--概念、特征、架构与案例概述
![[postgraduate entrance examination vocabulary training camp] day 14 - Panini, predict, access, apologize, sense, transport, aggregation](/img/fb/0338559494f31db8657f0e4767138b.png)
[postgraduate entrance examination vocabulary training camp] day 14 - Panini, predict, access, apologize, sense, transport, aggregation

MySQL学习笔记-2.如何提高sql语句的查询性能

2022年流动式起重机司机考试试题模拟考试平台操作
随机推荐
Model definition pytorch learning
Mongodb stats counts the space occupied by the collection
【Swoole系列3.1】进程、线程、协程,面试你被问了吗?
[postgraduate entrance examination vocabulary training camp] day 13 - reliance, expert, subject, unconscious, photograph, exaggeration, counter act
LeetCode笔记:Biweekly Contest 83
Introduction to Seata
ReentrantLock学习之---释放锁过程
LeetCode简单题之装满杯子需要的最短总时长
2022茶艺师(中级)考试题模拟考试题库及答案
配置服务器环境
Tensorflow-GPU 1.15安装
2022t elevator repair examination questions and online simulation examination
MySQL learning notes -2. how to improve the query performance of SQL statements
Vs2019 export import configuration
(ICLR-2022)TADA! Time adaptive convolution for video understanding
Leetcode notes: biweekly contest 83
MySQL - function and constraint commands
How to solve the problem that win11 has been switched on after upgrading
EN 1504-7混凝土结构保护和修理用产品钢筋防腐—CE认证
Utility website recommendations