当前位置:网站首页>Detailed tutorial on installing stand-alone redis
Detailed tutorial on installing stand-alone redis
2022-07-02 19:33:00 【Charmaine Xia】
1. Download installation package
① Create a new directory on this computer
mkdir /home/admin/redis
② Go to the official website to download the installation package :https://redis.io/download/
③ Copy the installation package to the current virtual machine /home/admin/redis Under the table of contents
2. decompression redis
① Switch redis Under the table of contents , Unzip the installation package
cd /home/admin/redis
tar -zxvf redis-5.0.7.tar.gz
3. Install the basic environment
① install gcc compiler
yum install gcc-c++
Check whether the installation is successful :gcc -v
(gcc It is a super that can compile executable programs on a variety of hardware platforms compiler ,Gcc The compiler can C、C++ Language source 、 Assembly programming and object program compilation 、 connect Executable file ,redis yes C Written language )
② Generate src file
cd redis-5.0.7
make
make install
③redis The default installation path for
cd /usr/local/bin
4. Backup redis The configuration file
① Create a new directory to modify the configuration file
mkdir /home/admin/redis/redis-5.0.7/theRedisConf
② Copy the configuration file ( The original text is put in the unzipped directory for backup , Start up with theRedisConf Profile under )
cp /home/admin/redis/redis-5.0.7/redis.conf /home/admin/redis/redis-5.0.7/theRedisConf/
5. modify redis The configuration file
vi /home/admin/redis/redis-5.0.7/theRedisConf/redis.conf
## modify 1: Comment as follows , After annotation redis You cannot receive any ip The connection of
# bind 127.0.0.1
## modify 2: Turn off protection mode ( If set to yes, Then we are only allowed to connect in the loopback of this machine , Other machines cannot be connected .)
protected-mode no
## modify 3: Turn on redis The service runs in the background
daemonize yes
## modify 4: Add log path , Easy to troubleshoot
logfile “/home/admin/redis/redis-5.0.7/redis.log”
5. start-up redis service
① Turn on the firewall
systemctl start firewalld.service
② Open the specified port number
Check the opened port number
firewall-cmd --list-ports
Open the specified port number , The port number of the following example is 6379
firewall-cmd --zone=public --add-port=6379/tcp --permanent
③ service iptables restart
Only when the port number is opened successfully
firewall-cmd --reload
④ Start the service
cd /usr/local/bin/
./redis-server /home/admin/redis/redis-5.0.7/theRedisConf/redis.conf
6. How to view redis process
ps -ef|grep redis
7. How to close redis service
① Enter the client
redis-cli -p 6379 Or enter src perform ./redis-cli -p 6379
② close redis service
shoutdown
③ Exit client
exit
Close the client without entering redis
redis-cli shutdown
边栏推荐
- Py之interpret:interpret的简介、安装、案例应用之详细攻略
- 冒泡排序数组
- Pytorch版本、CUDA版本与显卡驱动版本的对应关系
- Reading notes of "the way to clean structure" (Part 2)
- 数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
- Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
- 《架构整洁之道》读书笔记(下)
- AcWing 1137. Select the best line solution (the shortest circuit)
- 453-atoi函数的实现
- C file input operation
猜你喜欢
Markdown basic grammar
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
Yolov3 trains its own data set to generate train txt
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5
AcWing 340. 通信线路 题解(二分+双端队列BFS求最短路)
Data dimensionality reduction factor analysis
开发固定资产管理系统,开发固定资产管理系统用什么语音
教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5
Codeworks 5 questions per day (1700 average) - day 4
随机推荐
函数高阶-柯里化实现
PHP非对称加密方法私钥及公钥加密解密的方法
冒泡排序数组
End-to-End Object Detection with Transformers(DETR)论文阅读与理解
[pytorch learning notes] tensor
What is the MySQL backup suffix_ MySQL backup restore
AcWing 1134. 最短路计数 题解(最短路)
High frequency interview questions
[error record] problems related to the installation of the shuttle environment (follow-up error handling after executing the shuttle doctor command)
PHP parser badminton reservation applet development requires online system
横向越权与纵向越权[通俗易懂]
Horizontal ultra vires and vertical ultra vires [easy to understand]
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
PHP-Parser羽毛球预约小程序开发require线上系统
开发固定资产管理系统,开发固定资产管理系统用什么语音
Bubble sort array
Typescript 之 快速入门
Function high order curry realization
搭建主从模式集群redis
高级性能测试系列《24. 通过jdbc执行sql脚本》