当前位置:网站首页>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
边栏推荐
- Yolov5 advanced III training environment
- [cloud primordial | kubernetes chapter] go deep into the foundation of all things - container (V)
- Selenium 搭建 Cookies池 绕过验证反爬登录
- PD快充磁吸移动电源方案
- phpcms v9去掉phpsso模块
- Yolov5进阶之四训练自己的数据集
- Section IV HQL execution process
- 【程序的编译和预处理】
- Leetcode: array fast and slow pointer method
- Autoregressive model of Lantern Festival
猜你喜欢
Notes on setting qccheckbox style
Optimize quiver function in MATLAB to draw arrow diagram or vector diagram (1) -matlab development
设置QCheckbox 样式的注意事项
Section IV HQL execution process
【云原生 | Kubernetes篇】深入万物基础-容器(五)
phpcms小程序插件api接口升级到4.3(新增批量获取接口、搜索接口等)
Playing card image segmentation
隐藏式列表菜单以及窗口转换在Selenium 中的应用
dedecms小程序插件正式上线,一键安装无需任何php或sql基础
Yolov5 advanced 5 GPU environment setup
随机推荐
ThreadLocal
Nebula diagram_ Object detection and measurement_ nanyangjx
uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
隐藏式列表菜单以及窗口转换在Selenium 中的应用
MySQL在服务里找不到(未卸载)
如何利用最少的钱,快速打开淘宝流量入口?
Mongodb分片环境搭建和验证(redis期末大作业)
HDU - 6225 little boxes (\u int128)
Regular Expression 正则表达式
Tensorboard
Detailed explanation of traditional image segmentation methods
The solution of positioning failure caused by framework jump
Install Anaconda + NVIDIA graphics card driver + pytorch under win10_ gpu
PD fast magnetization mobile power supply scheme
[program compilation and pretreatment]
Selenium builds cookies pool to bypass authentication and anti crawl login
Phpcms applet interface new universal interface get_ diy. php
【MATLAB GUI】 键盘回调中按键识别符查找表
phpcms小程序接口新增万能接口get_diy.php
[Matlab GUI] key ID lookup table in keyboard callback