当前位置:网站首页>Docker install redis
Docker install redis
2022-06-26 09:04:00 【aserendipper】
1、 Search for Redis Mirror image , Or from Official website Query the required image in
docker search redis
2、 Select the image you want to download and pull it locally , The latest version image will be downloaded by default
docker pull redis
3、 because redis The default configuration can only connect locally , No remote access , So you need to mount it manually redis The configuration file , Create a new... On this computer data and conf Folders and redis Configuration file for
mkdir /docker/redis/data
mkdir /docker/redis/conf
cd /docker/redis/conf
vi redis.conf
# Comment out redis Can be accessed externally
#bind 127.0.0.1
# Start as a guard thread
daemonize no
# Set the password
requirepass 123456
#redis Turn on persistence
appendonly yes
# Prevent the remote host from forcing an existing connection to close Default 300
tcp-keepalive 300
4、 establish redis Container and start
docker run --name redis -p 6379:6379 -v /docker/redis/data:/data -v /docker/redis/conf/redis.conf:/etc/redis/redis.conf -d redis redis-server /etc/redis/redis.conf
- docker run: Run container
- –name redis: Container name
- -p 6379:6379: Will host the 6379 port ( Before colon ) Mapped to container 6379 port ( After the colon )
- -v /docker/redis/data:/data: Will host the /docker/redis/data The directory is attached to the container's /data Catalog
- -v /docker/redis/conf/redis.conf:/etc/redis/redis.conf: Will host the /docker/redis/conf/redis.conf The configuration file is attached to the container /etc/redis/redis.conf file
- -d redis: Background program running redis
- redis-server /etc/redis/redis.conf: Appoint redis Boot profile
5、 adopt docker ps Command view redis Startup successful
6、 Enter the container and connect redis
docker exec -it redis redis-cli -a 123456
边栏推荐
- Line detection_ nanyangjx
- phpcms v9去掉phpsso模块
- 微信小程序如何转换成百度小程序
- Data warehouse (3) star model and dimension modeling of data warehouse modeling
- Nebula diagram_ Object detection and measurement_ nanyangjx
- XSS 跨站脚本攻击
- yolov5进阶之零环境快速创建及测试
- 【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(一)
- Fast construction of neural network
- Regular Expression 正则表达式
猜你喜欢

Srv6---is-is extension

PD fast magnetization mobile power supply scheme

Computer mall based on SSM

ThreadLocal

Yolov5 advanced zero environment rapid creation and testing

Detailed explanation of traditional image segmentation methods

Euler function: find the number of numbers less than or equal to N and coprime with n
![[cloud primordial | kubernetes chapter] go deep into the foundation of all things - container (V)](/img/67/26508edc451139cd0f4c9511ca1ed2.png)
[cloud primordial | kubernetes chapter] go deep into the foundation of all things - container (V)

【MATLAB GUI】 键盘回调中按键识别符查找表

隐藏式列表菜单以及窗口转换在Selenium 中的应用
随机推荐
外部排序和大小堆相关知识
uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
修复小程序富文本组件不支持video视频封面、autoplay、controls等属性问题
浅谈一下Type-C接口发展历程
OpenGL display mat image
[300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
pgsql_ UDF01_ jx
基于SSM的毕业论文管理系统
Sqoop merge usage
Baidu applet rich text parsing tool bdparse
Yolov5进阶之三训练环境
HDU - 6225 little boxes (\u int128)
[QNX Hypervisor 2.2用户手册]12.2 术语(二)
Yolov5 advanced zero environment rapid creation and testing
PD快充磁吸移動電源方案
Isinstance() function usage
Data warehouse (1) what is data warehouse and what are the characteristics of data warehouse
torch. fft
如何利用最少的钱,快速打开淘宝流量入口?
SRv6----IS-IS扩展