当前位置:网站首页>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:清空所有数据库的键值对。
边栏推荐
- 数据库文档生成工具V1.0
- Interpretation of EfficientNet: Composite scaling method of neural network (based on tf-Kersa reproduction code)
- 核心价值观编码器【matlab版】
- Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
- ffmpeg打开rtsp流应该设置的几个参数
- JVM 快速检测死锁
- 狗都能看懂的Vision Transformer的讲解和代码实现
- RHCE之路----全
- Time Series Forecasting Based on Reptile Search RSA Optimized LSTM
- pycharm专业版使用
猜你喜欢
A semi-supervised Laplace skyhawk optimization depth nuclear extreme learning machine for classification
MySQL(4)
SENet detailed explanation and Keras reproduction code
E-R图总结规范
【C# - 爬虫】使用Selenium实现爬虫,获取近七天天气信息(包含完整代码)
Online public account article content to audio file practical gadget
科研绘图图表类型种类繁多,本文告诉你如何选择!
matlab的2DCNN、1DCNN、BP、SVM故障诊断与结果可视化
Detailed explanation of DenseNet and Keras reproduction code
如何用matlab做高精度计算?【第二辑】
随机推荐
RHCE之路----全
花了近70美元入手的学生版MATLAB体验到底如何?
MySQL配置文件配置
Detailed explanation of DenseNet and Keras reproduction code
系统流量预估、架构设计方案
Unable to preventDefault inside passive event listener due to target being treated as passive. See
MySQL大总结
SENet详解及Keras复现代码
基于时序模式注意力机制(TPA)的长短时记忆(LSTM)网络TPA-LSTM的多变量输入风电功率预测
字符串的一些方法
手把手教你Charles抓包工具使用
golang chan
元素的增删克隆以及利用增删来显示数据到页面上
VS 2017编译 QT no such slot || 找不到*** 问题
this关键字,构造函数
DenseNet详解及Keras复现代码
JVM 快速检测死锁
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
舍不得花钱买1stOpt,不妨试试这款免费的拟合优化神器【openLU】
用matlab打造的摩斯电码加解码器音频版,支持包括中文在内的任意字符