当前位置:网站首页>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
边栏推荐
- 【微积分】拉格朗日乘子法
- Practice is the fastest way to become a network engineer
- [IVI] 15.1.2 system stability optimization (lmkd Ⅱ) psi pressure stall information
- HDU - 6225 Little Boxes(__int128的使用)
- yolov5进阶之零环境快速创建及测试
- Yolov5进阶之二安装labelImg
- Pandas vs. SQL 1_ nanyangjx
- PD快充磁吸移動電源方案
- torch. fft
- Efficiency thesis Reading 1
猜你喜欢

Particles and sound effect system in games104 music 12 game engine

Drawing with MATLAB (1)

In depth study paper reading target detection (VII) Chinese version: yolov4 optimal speed and accuracy of object detection

phpcms v9商城模块(修复自带支付宝接口bug)

Slider verification - personal test (JD)

phpcms小程序插件4.0版正式上线

Yolov5进阶之一摄像头实时采集识别

Phpcms applet plug-in tutorial website officially launched

Yolov5 advanced zero environment rapid creation and testing

浅谈一下Type-C接口发展历程
随机推荐
Particles and sound effect system in games104 music 12 game engine
Backward usage
Implementation code of interceptor and filter
修复小程序富文本组件不支持video视频封面、autoplay、controls等属性问题
设置QCheckbox 样式的注意事项
Slider verification - personal test (JD)
Yolov5进阶之四训练自己的数据集
Solution to the encoding problem encountered by the crawler when requesting get/post
phpcms v9手机访问电脑站一对一跳转对应手机站页面插件
phpcms v9去掉phpsso模块
Which software is safer to open an account on
Mongodb分片环境搭建和验证(redis期末大作业)
pgsql_ UDF01_ jx
Isinstance() function usage
Optimize quiver function in MATLAB to draw arrow diagram or vector diagram (1) -matlab development
[300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
phpcms小程序插件4.0版正式上线
keras_ Callback function summary
9. code generation
实践是成为网工最快的方法,网络工程师实战项目整理