当前位置:网站首页>Docker installs redis-5.0.12. Detailed steps
Docker installs redis-5.0.12. Detailed steps
2022-06-24 22:21:00 【Nice2cu_ Code】
Docker install Redis-5.0.12
List of articles
One 、 Pull the mirror image
docker pull redis:5.0.12
Two 、 Look at the mirror image
docker images

Successful pull
3、 ... and 、 Modify the configuration file
because redis By default, you will find that you can only connect locally , No remote access , Use Redis Desktop Manager Error will be reported when connecting , So you need to mount it manually redis The configuration file .
Create folder
mkdir /opt/docker_redisEntry directory
cd /opt/docker_redisdownload
redis.conffilewget http://download.redis.io/redis-stable/redis.confDocument Authorization
chmod 777 redis.confModify configuration information
vim redis.confComment out bind 127.0.0.1, Remove local connection restrictions
Be careful : stay vim Editor , have access to
/ keywordQuickly locate the location of keywords
modify protected-mode, Protected mode , Limited to local access , Unprotect mode after modification

modify daemonize, Modify to daemon

Change Password
stay redis.conf Find requirepass foobared

Save the modified configuration file
Four 、 Start the container
docker run -p 6379:6379 --name myredis -v /opt/docker_/redis/redis.conf:/etc/redis/redis.conf -v /opt/docker_/redis/data:/data -d redis:5.0.12 redis-server /etc/redis/redis.conf --appendonly yes --requirepass Set password for
Command analysis :
-p 6379:6379 Port mapping : The front represents the host part ,: After that is the container part .
––name myredis Specify the container name , It's convenient to check and operate .
-v Mount a file or directory : The front represents the host part ,: After that is the container part .
-d redis Indicates background start redis
redis-server /etc/redis/redis.conf
Start with configuration file redis, Load the... In the container conf file , Finally, we found the directory of the mount /usr/local/docker/redis.conf
–appendonly yes Turn on redis Persistence
–requirepass Enter the set password
5、 ... and 、 Into the container
Check that the container is functioning
docker ps
Into the container
docker exec -it myredis /bin/bashGet into Redis client
redis-cli
Input password

边栏推荐
- PostMan工具介绍及安装使用
- Resolving the conflict problem of the flutter Library
- socket(2)
- What aspects should we start with in the feasibility analysis of dry goods?
- leetcode_ one thousand three hundred and sixty-five
- 权限想要细化到按钮,怎么做?
- Short video mall system, how does scroll view adapt to the remaining height of the page
- Process communication mode
- Mysql 通过表明获取字段以及注释
- ansible基本配置
猜你喜欢

leetcode:45. 跳跃游戏 II【经典贪心】

A pit in try with resources

60 divine vs Code plug-ins!!

I really want to send a bunch of flowers

Docker 安装 MySQL 8.0,详细步骤

Development trend and path of SaaS industry in China

“阿里健康”们的逻辑早就变了

壹沓科技签约七匹狼,助力「中国男装领导者」数字化转型

NIO多路复用之Selector的使用

The profound meaning of unlimited ecological development in Poka -- Multidimensional Interpretation of parallel chain
随机推荐
磁盤的結構
Process communication mode
软件设计的七大原则
L2 元年,Arbitrum Nitro 升级带来更兼容高效的开发体验
How to refine permissions to buttons?
Description of software version selection of kt6368a Bluetooth dual-mode transparent chip
A girl has been making hardware for ten years. 。。
leetcode:515. Find the maximum value in each tree row [brainless BFS]
进程的通信方式
直播软件app开发,左右自动滑动的轮播图广告
NIO、BIO、AIO
EasyBypass
字符串习题总结2
Implementation of heap sort and quick sort principle
是真干不过00后,给我卷的崩溃,想离职了...
LINQ query collection class introductory cases Wulin expert class
A pit in try with resources
The process from troubleshooting to problem solving: the browser suddenly failed to access the web page, error code: 0x80004005, and the final positioning: "when the computer turns on the hotspot, the
壹沓科技签约七匹狼,助力「中国男装领导者」数字化转型
leetcode:55. Jumping game [classic greed]