当前位置:网站首页>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
边栏推荐
- Clion installation + MinGW configuration + opencv installation
- How to set the shelves and windows, and what to pay attention to in the optimization process
- 1.27 pytorch learning
- uniapp用uParse实现解析后台的富文本编辑器的内容及修改uParse样式
- Efficiency thesis Reading 1
- 小程序实现图片预加载(图片延迟加载)
- [300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (I)
- Isinstance() function usage
- Leetcode: array fast and slow pointer method
- Section IV HQL execution process
猜你喜欢
随机推荐
Optimize quiver function in MATLAB to draw arrow diagram or vector diagram (1) -matlab development
Regular Expression 正则表达式
Degree of freedom analysis_ nanyangjx
【MATLAB GUI】 键盘回调中按键识别符查找表
ImportError: ERROR: recursion is detected during loading of “cv2“ binary extensions. Check OpenCV in
PD fast magnetization mobile power supply scheme
Slider verification - personal test (JD)
phpcms v9手机访问电脑站一对一跳转对应手机站页面插件
Pytorch neural network
Data warehouse (3) star model and dimension modeling of data warehouse modeling
PD快充磁吸移动电源方案
XSS cross site scripting attack
phpcms手机站模块实现自定义伪静态设置
Google Chrome collection
Computer mall based on SSM
[Matlab GUI] key ID lookup table in keyboard callback
Checkerboard generation + camera calibration + stereo matching
HDU - 6225 little boxes (\u int128)
Principle of playing card image segmentation
Mongodb分片环境搭建和验证(redis期末大作业)









