当前位置:网站首页>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

边栏推荐
- Valueerror: cannot take a larger sample than population when 'replace=false‘
- AQS源码分析
- 揭秘B站,程序员穿女装敲代码,效率更高是真的吗?
- Two implementation methods of stack
- OA system -- save the verification code to session
- Notes on writing questions (18) -- binary tree: common ancestor problem
- Disk structure
- Docker 安装 MySQL 8.0,详细步骤
- Object. Defineproperty and reflect Fault tolerance of defineproperty
- Reduce the pip to the specified version (upgrade the PIP through pycharm, and then reduce it to the original version)
猜你喜欢
随机推荐
OA system -- save the verification code to session
无心剑汉英双语诗003. 《书海》
Flutter: Unsupported value: false/true
DAO 中常见的投票治理方式
直播软件app开发,左右自动滑动的轮播图广告
TCP RTT测量妙计
Structure du disque
华大04a工作模式/低功耗模式
Flutter 如何使用在线转码工具将 JSON 转为 Model
The profound meaning of unlimited ecological development in Poka -- Multidimensional Interpretation of parallel chain
降低pip到指定版本(通過PyCharm昇級pip,在降低到原來版本)
华大4A0GPIO设置
Double linked list implementation
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
Heartless sword Chinese English bilingual poem 003 The sea of books
Stl+ tree
Why can some programmers get good offers with average ability?
Balanced binary search tree
60 个神级 VS Code 插件!!
EasyBypass








