当前位置:网站首页>ubuntu18.04安装redis教程
ubuntu18.04安装redis教程
2022-08-04 05:38:00 【pengege666】
redis简介
Redis(Remote Dictionary Server ),即远程字典服务,是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。Redis 是单线程的
- 官网:https://redis.io/
- 中文社区:http://www.redis.cn/

linux下redis安装
环境:Ubuntu Server 18.04.1 LTS 64bit
1.下载源码
wget https://download.redis.io/releases/redis-6.0.9.tar.gz
2.解压
tar xzf redis-6.0.9.tar.gz
3.将安装文件移动到user/local下
sudo mv ./redis-6.0.9 /usr/local/redis
cd /usr/local/redis
4.编译redis(注意:查看gcc-g++是否安装)
sudo make
5.测试编译是否成功
sudo make test
bug:
*** [err]: diskless no replicas drop during rdb pipe in tests/integration/replication.tcl
rdb child didn't terminate *** [err]: diskless fast replicas drop during rdb pipe in tests/integration/replication.tcl rdb child didn't terminate
直接安装,索性没有出问题。
6.安装
sudo make install


连接redis
先将/usr/local/redis下的redis.conf配置文件移动到/usr/local/bin/kconfig中
[email protected]:/usr/local/bin$ sudo mkdir kconfig
[email protected]:/usr/local/bin$ l
chardetect* jsonschema* kconfig/ pip* pip2* pip2.7* redis-benchmark* redis-check-aof* redis-check-rdb* redis-cli* [email protected] redis-server*
[email protected]:/usr/local/bin$ sudo cp /usr/local/redis/redis.conf /usr/local/bin/kconfig/

修改kconfig/redis.conf(由于redis默认不是后台启动的,因此需要修改配置文件!)
[email protected]:/usr/local/bin/kconfig$ sudo vim redis.conf

启动redis服务
[email protected]:/usr/local/bin$ redis-server kconfig/redis.conf
[email protected]:/usr/local/bin$ ls
chardetect jsonschema kconfig pip pip2 pip2.7 redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server
#使用redis客户端进行连接
[email protected]:/usr/local/bin$ redis-cli -p 6379
127.0.0.1:6379> PING
PONG
127.0.0.1:6379>
查看redis进程是否开启
开启新的shell查看进程
ps -ef|grep redis

关闭redis
shutdown
exit
BUT,有BUG出现◑﹏◐
127.0.0.1:6379> shutdown
(error) ERR Errors trying to SHUTDOWN. Check logs.
参考博客
(error) ERR Errors trying to SHUTDOWN. Check logs.错误
简单命令
select 3 #切换数据库
dbsize #查看数据库大小
keys * :查看当前数据库中所有的key。
flushdb:清空当前数据库中的键值对。
flushall:清空所有数据库的键值对。
边栏推荐
- Gramm Angle field GAF time-series data into the image and applied to the fault diagnosis
- Time Series Forecasting Based on Reptile Search RSA Optimized LSTM
- 狗都能看懂的变化检测网络Siam-NestedUNet讲解——解决工业检测的痛点
- 花了近70美元入手的学生版MATLAB体验到底如何?
- Implementation of ICEEMDAN Decomposition Code in MATLAB
- MATLAB版量化交易技术分析工具TA-Lib【不付费也可获取,不要被付费吓跑】
- A priori box (Anchor) in target detection
- 狗都能看懂的Vision Transformer的讲解和代码实现
- Based on the EEMD + + MLR GRU helped time series prediction
- CMDB 腾讯云部分实现
猜你喜欢
随机推荐
golang rtsp拉流测试
【音视频开发系列】fdk_aac 之 PCM 转 AAC
天鹰优化的半监督拉普拉斯深度核极限学习机用于分类
Centos通过Docker搭建MySQL的PXC集群
matlab的2DCNN、1DCNN、BP、SVM故障诊断与结果可视化
在线公众号文章内容转音频文件实用小工具
【C# - 方法封装】数据转换
idea使用@Autowired注解爆红原因及解决方法
更改mysql数据库默认的字符集(mysql 存储 emoji表情)
DOM的12中节点类型,通过关系或方法获取DOM节点,渲染到浏览器页面的一些特效功能,获取DOM节点来改变属性,点击图片,切换为所点击的图片为背景图,页面上的表单验证,点击底部导航栏切换界面
Based on the EEMD + + MLR GRU helped time series prediction
QT 显示窗口到最前面(非置顶)
RuntimeError: You called this URL via POST, but the URL doesn‘t end in a slash and you have APPEND_S
Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
JVM调优实践
专属程序员的浪漫七夕
自适应迁移学习核极限学习机用于预测
Database knowledge: SQLServer creates non-sa user notes
ThreadLocal内存泄漏问题讲解
av_read_frame 阻塞,基于回调的解决办法
![[漏洞问题] log4j漏洞 关于2.17.0升级到2.18.0 方案](/img/f2/2052277ae440279b33248ae51a970f.png)








