当前位置:网站首页>Docker安装Redis详细步骤
Docker安装Redis详细步骤
2022-08-09 14:29:00 【Eric-x】
前言:记录在 Docker 中安装 Redis 的每一个步骤
1、打开Linux终端,输入命令下载redis镜像文件
sudo docker pull redis
2、创建实例并启动
-- 注意:需要先创建挂载目录和redis.conf文件
mkdir -p /mydata/redis/conf
touch /mydata/redis/conf/redis.conf
docker run -p 6379:6379 --name redis \
-v /mydata/redis/data:/data \
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
-d redis redis-server /etc/redis/redis.conf
-- 进入redis客户端:
docker exec -it redis redis-cli
-- 存数据:
set a b
-- 取数据
get a
-- 修改redis数据持久化:
vi /mydata/redis/conf/redis.conf
-- 输入:
appendonly yes
:wq
-- 重启redis:
docker restart redis
为了方便我们可以安装Redis的可视化客户端
1、进入官网:Redis可视化工具下载,点击下载
2、下载好后傻瓜式安装:Next >> I Agree >> Install >> Next >> Finish
3、使用客户端连接Redis
搞定收工~
边栏推荐
猜你喜欢
The code implementation of chess
【软考】2022年上半年软考过啦
A wave of Versailles: assault by the ali interview guide, I've got nine of the Offer
[Serilog] Simple .NET logging with fully structured events
零时科技 | Nomad 跨链桥被盗1.8亿美元事件分析
【Serilog】具有完全结构化事件的简单.NET日志记录
Recursive implementation of the Tower of Hanoi problem
概率论基础知识整理 | 随机向量
基于微信云开发的幼儿园招生报名小程序
Simulink simulation pid control servo system
随机推荐
Assembly language learning (9)
After reading the "Redis In-depth Notes" compiled by Tencent bosses in 90 days, I worshipped on the spot.
Fiddler弱网测试
Architect's learning experience summary
结合实际聊聊电平转换电路(常用电平转换电路总结)
OpenFeign使用示例
Assembly language learning (1)
leetcode 剑指 Offer 17. 打印从1到最大的n位数
*1-2 OJ 190 run-length code
*3-1 CCF 2014-09-1 Adjacent pairs
resNet_model—定义残差网络模型
基于微信云开发的幼儿园招生报名小程序
Assembly language learning (3)
新起之秀 DPU,正在掀起数据中心变革!
【微服务】nacos注册中心和配置中心详解
常用sql记录
[Microservice] Detailed explanation of nacos registration center and configuration center
Use Baidu EasyDL to realize intelligent identification of health code/travel code in 30 minutes
【Database】Sqlserver如何定时备份数据库和定时清除
除非另外还指定了 TOP、OFFSET 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询和公用表表达式中无效