当前位置:网站首页>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:清空所有数据库的键值对。
边栏推荐
- Jenkins pipeline 自动部署实践
- RuntimeError: You called this URL via POST, but the URL doesn‘t end in a slash and you have APPEND_S
- Network skills: teach you to install batteries on the router, you can still surf the Internet when the power is cut off!
- QT 出现多冲定义问题
- [漏洞问题] log4j漏洞 关于2.17.0升级到2.18.0 方案
- Time Series Forecasting Based on Reptile Search RSA Optimized LSTM
- 对产品设计,架构设计的一点思考
- Logical Address & Physical Address
- JVM 快速检测死锁
- golang 坐标格式 转换 GCJ02ToWGS84
猜你喜欢
MAML principle explanation and code implementation
Computer knowledge: desktop computers should choose the brand and assembly, worthy of collection
窥探晶体世界的奥秘 —— 230种空间群晶体结构模型全在这里
用手机也能轻松玩转MATLAB编程
如何画好业务架构图。
SENet detailed explanation and Keras reproduction code
Network skills: teach you to install batteries on the router, you can still surf the Internet when the power is cut off!
CMDB 腾讯云部分实现
Computer software: recommend a disk space analysis tool - WizTree
HbuilderX 启动微信小程序 无法打开项目
随机推荐
Database document generation tool V1.0
Base64编码原理
Error occurred while trying to proxy request项目突然起不来了
QT 出现多冲定义问题
七夕专属程序员的浪漫
mysql月份比較是否相等
CMDB 阿里云部分实现
Promise.all 使用方法
Logical Address & Physical Address
EfficientNet解读:神经网络的复合缩放方法(基于tf-Kersa复现代码)
CMDB 腾讯云部分实现
mysql:列类型之float、double
RHCE之路----全
nacos 返回 403 unknown user 太他么坑了 源码解析
专属程序员的浪漫七夕
2DCNN, 1DCNN, BP, SVM fault diagnosis and result visualization of matlab
ffmpeg打开rtsp流应该设置的几个参数
舍不得花钱买1stOpt,不妨试试这款免费的拟合优化神器【openLU】
【音视频开发系列】QT 采集麦克风PCM并播放
YOLOv3详解:从零开始搭建YOLOv3网络