当前位置:网站首页>Installation, start and stop of redis7 under Linux
Installation, start and stop of redis7 under Linux
2022-07-31 02:11:00 【Small dust be confident】
Redis是一个开源的key-value存储系统.它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型).Install before learningredis就显得非常重要了.This article will be installed with redis7为例.
redis7
1.redis下载
官网地址:https://redis.io/download/
如果觉得下载麻烦,我已经提供了Redis安装包下载:
版本:redis-7.0.4.tar
下载地址:
链接:https://pan.baidu.com/s/1DCIxRXokzsTfGrdQ-Eh3eA
提取码:ajpl
1.官网点击下载:

2.下载完成之后,打开xhell连接Linux,通过xftp把我们下载好的Redis压缩包,上传到Linux的 /opt/ 文件目录下(文件路径不固定)

关于xhell与xfptDownload see:
3.进入到/mnt/ 文件目录中,解压 redis-5.0.0.tar.gz,并把redis-5.0.0移动到/usr/local/ 目录下
2.安装gcc环境
由于redis是由C语言编写的,它的运行需要C环境,因此我们需要先安装gcc.安装命令如下:
1.检查是否有gcc环境:gcc --version
The following appears to indicate yes.则无需安装

2.如果提示gcc不是内部命令,则需要安装,命令:yum install gcc
3.安装redis
1.First we get into oursredis压缩包存放位置(之前上传的)

2.执行解压缩,命令:tar -zxvf redis-7.0.4.tar.gz

3.进入到解压后的目录,执行make命令进行编译

如果没有准备好C语言编译环境,make 会报错—Jemalloc/jemalloc.h:没有那个文件
解决办法:
首先看:gcc是否安装成功,成功后
运行make distclean, Clear the compiled files,然后再在redis-7.0.4目录下再次执行make命令(只是编译好)
4.跳过make test 继续执行: make install

以下表示安装成功:默认安装目录:/usr/local/bin

进入目录查看:

文件介绍:
redis-benchmark:性能测试工具,可以在自己本子运行,看看自己本子性能如何
redis-check-aof:修复有问题的AOF文件
redis-check-dump:修复有问题的dump.rdb文件
redis-sentinel:Redis集群使用
redis-server:Redis服务器启动命令
redis-cli:客户端,操作入口
The installation is now complete!
3.启动redis(Foreground startup and background startup)
前台启动(不推荐)
Use this startup method:命令行窗口不能关闭,否则服务器停止.And this window can not do other operations
在bin目录下执行 redis-server

启动成功:

默认端口号:6379
后台启动(推荐)
1.进入到redis的安装目录下,cd /opt/redis-7.0.4/

找到文件redis.conf,It is important to modify this file,For convenience, we can copy the file to a directory for operation.I choose to copy to hereetc下

2.进入到etc目录下,修改文件redis.conf,设置daemonize no改成yes
执行:vim redis.conf 命令,Due to the large file content,It can be entered via quick search:/daemAdd a carriage return to quickly locate the content that needs to be modified.

3.Save and exit after completing the modification and start through the configuration fileredis
进入到:cd /usr/local/bin目录下,执行redis-server /etc/redis.conf

这样就完成了redis的启动,通过ps -ef | grep redis查看是否启动

通过redis-cli连接redis

4.关闭redis(两种方式)
第一种.执行shutdown

第二种.先找到进程号:ps -ef | grep redis
kill -9 9468

以上就是Linux下安装Redis的全过程,Hope to install it for everyoneRedis有所帮助.欢迎评论留言.
边栏推荐
- Interprocess communication study notes
- 两个有序数组间相加和的Topk问题
- Static routing + PAT + static NAT (explanation + experiment)
- 加密生活,Web3 项目合伙人的一天
- 二层广播风暴(产生原因+判断+解决)
- multiplayer-hlap 包有问题,无法升级的解决方案
- MySQL stored procedure
- What level of software testing does it take to get a 9K job?
- User interaction + formatted output
- 【Bank Series Phase 1】People's Bank of China
猜你喜欢

Static route analysis (the longest mask matching principle + active and standby routes)

Drools Rule Properties, Advanced Syntax

STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道

Fiddler captures packets to simulate weak network environment testing

16. Registration Center-consul

Tower of Hanoi problem

Drools basic introduction, introductory case, basic syntax

【银行系列第一期】中国人民银行

Nacos

静态路由+PAT+静态NAT(讲解+实验)
随机推荐
MPPT太阳能充放电控制器数据采集-通过网关采集电池电压容量电量SOC,wifi传输
leetcode-128:最长连续序列
There is a problem with the multiplayer-hlap package and the solution cannot be upgraded
mysql view
Introduction to flask series 】 【 flask - using SQLAlchemy
直播预告 | KDD2022博士论文奖冠亚军对话
Brute Force/Adjacency List Breadth First Directed Weighted Graph Undirected Weighted Graph
Static routing + PAT + static NAT (explanation + experiment)
Introduction and use of Drools WorkBench
【Map与Set】之LeetCode&牛客练习
"Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
项目开发软件目录结构规范
Linux下redis7的安装,启动与停止
[1154]如何将字符串转换为datetime
静态路由+PAT+静态NAT(讲解+实验)
After reading "MySQL Database Advanced Practice" (SQL Xiao Xuzhu)
934. 最短的桥
Nacos
Validate XML documents
STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道