当前位置:网站首页>Redis安装
Redis安装
2022-07-23 03:38:00 【java塑造中...】
目录


安装版本
- 6.2.1 for Linux(redis-6.2.1.tar.gz)
- 不用考虑在windows环境下对Redis的支持
安装步骤
首先有个虚拟机就行,我用的是centOS7
准备工作:下载安装最新版的gcc编译器
安装C 语言的编译环境
yum install centos-release-scl scl-utils-build
yum install -y devtoolset-8-toolchain
scl enable devtoolset-8 bash
测试 gcc版本
gcc --version

下载redis-6.2.1.tar.gz通过共享文件夹放/opt目录
解压命令:tar -zxvf redis-6.2.1.tar.gz
解压完成后进入目录:cd redis-6.2.1
在redis-6.2.1目录下再次执行make命令(只是编译好)
如果没有准备好C语言编译环境,make 会报错—Jemalloc/jemalloc.h:没有那个文件

解决方案:运行make distclean

在redis-6.2.1目录下再次执行make命令(只是编译好)

跳过make test 继续执行: make install即可安装成功

启动方式:
前台启动不推荐
后台启动(推荐)
备份redis.conf
拷贝一份redis.conf到其他目录
cp /opt/redis-3.2.5/redis.conf /myredis
后台启动设置daemonize no改成yes
修改redis.conf(128行)文件将里面的daemonize no 改成 yes,让服务在后台启动
Redis启动
redis-server /myredis/redis.conf

用客户端访问:
redis-cli
![]()
- 多个端口可以:redis-cli -p6379
- 测试验证: ping
![]()
Redis关闭
单实例关闭:redis-cli shutdown
或者直接 exit

也可以进入终端后再关闭
![]()
多实例关闭,指定端口关闭: redis-cli -p 6379 shutdown
边栏推荐
- This tool complements the last kilometer of JMeter performance analysis
- 【C语言基础】16 可变数组(数组长度可扩展)
- 图文并茂演示小程序movable-view的可移动范围
- [C language foundation] 16 variable array (array length can be extended)
- 金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(七))
- Sum of three numbers: (sort + double pointer + pruning)
- Multi UA V cooperative exploring for the unknown interior environment based on dynamic target tracking
- [MySQL] cursor
- 华泰证券可以网上开户吗安全吗
- Read write barrier in memory barrier -- concurrency problem
猜你喜欢

How does the browser import and export | delete bookmarks? Here are the steps

【C语言基础】16 可变数组(数组长度可扩展)

Nine charts overview the cycle law of encryption Market

【Azure 事件中心】Azure Event Hub 新功能尝试 -- 异地灾难恢复 (Geo-Disaster Recovery)

SSH超市进销存管理系统

STM32 - input capture experiment

L-cysteine modified gold nanoparticles (Cys GNPs) and bovine serum albumin / biotinylated albumin nanoparticles

STM32——输入捕获实验

How to do the system security test? Let's talk about it in detail

SSM framework takeout ordering system
随机推荐
Open source Invoicing system, 10 minutes to complete, it is recommended to collect!
[MySQL] cursor
金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(八))
博世BOSCH EDI项目案例
专题训练-链表
转行软件测试薪资10K | 手中有粮心中有底,在任何时候都是真理
Self organization is the two-way rush of managers and members
时间序列-第三方库:tsfresh【特征提取、特征选择】
The gospel of small and medium-sized enterprises is coming! Jnpf is becoming popular, helping business digital upgrading
宇视NVR设备接入EasyCVR平台,离线后无法上线该如何解决?
JS div scroll to the bottom
Scala对象object
How to build and use redis fragment cluster
范式及反范式
Android development learning diary - content provider (cross application database modification)
30行自己写并发工具类(Semaphore, CyclicBarrier, CountDownLatch)是什么体验?
A concise tutorial for soft exam system architecture designer | reverse engineering
实现城市治理一网统管,必须这 4 个关键技术
什么是Per-Title编码?
金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(四))