当前位置:网站首页>Redis安装(Ubuntu)
Redis安装(Ubuntu)
2022-07-25 09:17:00 【__Samual】
一、下载
步骤1:
在Ubuntu中打开终端,输入下列命令,下载Redis安装包:
wget http://download.redis.io/releases/redis-4.0.9.tar.gz示例:

步骤2:
对安装包进行解压,并将其移动放到usr/local⽬录下
命令如下:
解压:
tar xzf redis-4.0.9.tar.gz移动:
sudo mv ./redis-4.0.9 /usr/local/redis/示例: 
步骤3:
进入redis⽬录,编译生成
命令:
cd /usr/local/redis/sudo make示例:

步骤4:
测试
sudo make test步骤5:
安装,将redis的命令安装到/usr/local/bin/⽬录
sudo make install步骤6:
安装完成后,我们进入目录/usr/local/bin中查看
cd /usr/local/bin
ls -all示例:


- redis-server redis服务器
- redis-cli redis命令行客户端
- redis-benchmark redis性能测试工具
- redis-check-aof AOF文件修复工具
- redis-check-rdb RDB文件检索工具
步骤7:
配置⽂件,移动到/etc/⽬录下
配置⽂件⽬录为/usr/local/redis/redis.conf
sudo cp /usr/local/redis/redis.conf /etc/redis/
二、配置
Redis的配置信息在
/etc/redis/redis.conf下。查看
sudo vi /etc/redis/redis.conf
核心配置选项
- 绑定ip:如果需要远程访问,可将此⾏注释,或绑定⼀个真实ip
bind 127.0.0.1
- 端⼝,默认为6379
port 6379
是否以守护进程运⾏
- 如果以守护进程运⾏,则不会在命令⾏阻塞,类似于服务
- 如果以⾮守护进程运⾏,则当前终端被阻塞
- 设置为yes表示守护进程,设置为no表示⾮守护进程
- 推荐设置为yes
daemonize yes
数据⽂件
dbfilename dump.rdb
- 数据⽂件存储路径
dir /var/lib/redis
- ⽇志⽂件
logfile "/var/log/redis/redis-server.log"
- 数据库,默认有16个
database 16
- 主从复制,类似于双机备份。
slaveof
边栏推荐
- uni-app - Refused to display ‘xxx‘ in a frame because an ancestor violates the following Content Sec
- Network principle (2) -- network development
- 2022-7-14 JMeter pressure test
- [buuctf-n1book][Chapter 2 advanced web]ssrf training
- CentOS changes MySQL database directory
- activemq--消息重试机制
- Mongodb exploration phase [easy to understand]
- [BUUCTF-n1book][第二章 web进阶]SSRF Training
- 有误差的字符串型时间比较方法String.compareTo
- Ctfhub skill tree Web
猜你喜欢

idea 热部署
[learn rust together] a preliminary understanding of rust package management tool cargo

ActiveMQ -- dead letter queue
![[stl]list Simulation Implementation](/img/92/2a78382700c1ebf299c6505d962c9c.png)
[stl]list Simulation Implementation

Arrange the array into the smallest number
![[WSN communication] optimize HWSN energy-saving clustering protocol based on MATLAB biogeography [including Matlab source code, 1989]](/img/47/c804acc3f8de1f0cd5938c3d889e46.png)
[WSN communication] optimize HWSN energy-saving clustering protocol based on MATLAB biogeography [including Matlab source code, 1989]

How to avoid duplicate data when the database is high and distributed

Probe into Druid query timeout configuration → who is the querytimeout of datasource and jdbctemplate effective?
![[BUUCTF-n1book][第二章 web进阶]SSRF Training](/img/29/8894d04b27e0e73c4458c27bd9b935.png)
[BUUCTF-n1book][第二章 web进阶]SSRF Training

Sort out Huawei ap-3010dn_ V2 configuration create WiFi
随机推荐
Unity ugui interaction (new ideas)
Interviewer: tell me the difference between redis and mongodb? [easy to understand]
OverTheWire-Bandit
activemq--消息重试机制
activemq--可持久化机制之KahaDB
【线程知识点】-- 自旋锁
『每日一问』LockSupport怎么实现线程等待、唤醒
Thymeleaf 笔记
NFT guide for musicians
Redis sentry, master-slave deployment details
[stl]list Simulation Implementation
activemq--死信队列
[deep learning] overview | the latest progress of deep learning
Sort out Huawei ap-3010dn_ V2 configuration create WiFi
[buuctf-n1book][Chapter 2 advanced web]ssrf training
深入理解static关键字
使用nexus3发布yum私服(离线-内网)
How can technologists start their personal brand? Exclusive teaching of top five KOLs
idea实用tips---如今将pom.xml(红色)改为pom.xml(蓝色)
MySQL takes the query result as the data updated by update, and concatenates it after the original field data (Lej)