当前位置:网站首页>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
边栏推荐
- PHP parser badminton reservation applet development requires online system
- codeforces每日5题(均1700)-第四天
- AcWing 1137. Select the best line solution (the shortest circuit)
- 数据降维——主成分分析
- SIFT特征点提取「建议收藏」
- End to end object detection with transformers (Detr) paper reading and understanding
- 高级性能测试系列《24. 通过jdbc执行sql脚本》
- 【pytorch学习笔记】Tensor
- mybatiesHelperPro工具必须的可以生成到对应项目文件夹下
- 横向越权与纵向越权[通俗易懂]
猜你喜欢

Reading notes of "the way to clean structure" (Part 2)

数据降维——因子分析

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5

High frequency interview questions

Thread application instance

潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5

AcWing 340. 通信线路 题解(二分+双端队列BFS求最短路)

AcWing 342. 道路与航线 题解 (最短路、拓扑排序)
随机推荐
AcWing 383. Sightseeing problem solution (shortest circuit)
Machine learning notes - time series prediction research: monthly sales of French champagne
MySQL
GMapping代码解析[通俗易懂]
Excel finds the same value in a column, deletes the row or replaces it with a blank value
Thread application instance
AcWing 1131. Saving Private Ryan (the shortest way)
AcWing 343. 排序 题解(floyd性质实现传递闭包)
NPOI导出Excel2007
数据降维——因子分析
AcWing 1125. Cattle travel problem solution (shortest path, diameter)
How to print mybats log plug-in using XML file
Quanzhi A33 uses mainline u-boot
Binary operation
潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失
机器学习笔记 - 时间序列预测研究:法国香槟的月销量
【pytorch学习笔记】Tensor
Registration opportunity of autowiredannotationbeanpostprocessor in XML development mode
MySQL
《代碼整潔之道》讀書筆記