当前位置:网站首页>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
搞定收工~
边栏推荐
猜你喜欢

YOLOv5网络详解

OpenCV笔记整理【视频处理】

深圳堡垒机厂家有哪些?重点推荐哪家?

Assembly Language Learning (6) Curriculum Design 1

猴蝎美人

VMWare does not use easy install, install ISO manual manually

一款翻译机背后的全球经济浪潮

Refuse to "reinvent the wheel", Baidu EasyDL lets you play with AI custom development

Which applet making software is easy to use?how to choose?

正则表达式实战:最新豆瓣top250爬虫超详细教程
随机推荐
ArcGIS在国土空间·城乡规划中的实战应用
VSTO踩坑记录(2)- 运用outlook对象模型发送邮件
探索进军元宇宙的代表性企业
实践数据湖iceberg 第三十九课 清理快照前后数据文件变化分析
CTF problem solution five Web PHP Dafa (experiment)
太厉害了!华为大牛终于把MySQL讲的明明白白(基础+优化+架构)
零时科技 | Nomad 跨链桥被盗1.8亿美元事件分析
Recursive implementation of the Tower of Hanoi problem
[DevOps] jekins deployment (1)
下班后用微信工作发病是否属于工伤?法院这样判
[Serilog] Simple .NET logging with fully structured events
Item 37: Make std::threads unjoinable on all paths.
Add-apt-repository command details
我的创作纪念日
Introduction to JUC Containers
Refuse to "reinvent the wheel", Baidu EasyDL lets you play with AI custom development
uniapp学习
[Microservice] Detailed explanation of nacos registration center and configuration center
【DevOps】jekinsBuild step 'Execute shell' marked build as failure
Assembly language learning (7)