当前位置:网站首页>Docker installation redis
Docker installation redis
2022-06-09 02:24:00 【Tag heartbeat】
List of articles
step
1. Pull redis Mirror image
docker pull redis
2. Create mount directory
mkdir -p /srv/redis/conf
mkdir -p /srv/redis/data
3. download redis.conf file
Enter the first conf Catalog :
cd /srv/redis/conf
Download the official conf file :
wget http://download.redis.io/redis-stable/redis.conf
4. give redis.conf jurisdiction
chmod 777 redis.conf
chmod 777 Is to change the file read and write permissions , and chmod +x Is to change the file status to executable .

5. Modify default configuration information
vim redis.conf
Modify the following parameters :
bind 127.0.0.1 # This line needs to be commented out , Remove local connection restrictions
protected-mode no # Default yes, If set to yes, Only the loopback connection of this machine is allowed , Other machines cannot be connected .
daemonize no # Default no Not in daemon mode ,docker The deployment does not need to be changed to yes,docker run -d Itself is the background startup , Otherwise, there will be conflicts
requirepass 123456 # Set the password
appendonly yes # Persistence
6. start-up redis
docker run --name redis \
-p 6379:6379 \
-v /srv/redis/conf/redis.conf:/etc/redis/redis.conf \
-v /srv/redis/data:/data \
-d redis redis-server /etc/redis/redis.conf --appendonly yes
Parameter description :
-p 6379:6379: Port mapping , In front is the host computer , Behind it is the container .
–name redis: Specify the container name .
-v Mount a file or directory : In front is the host computer , Behind it is the container .
-d redis redis-server /etc/redis/redis.conf: Indicates background start redis, Start with configuration file redis, Load the... In the container conf file .
appendonly yes: Turn on redis Persistence .
7. Release port ( Ignore the firewall )
Parameter description : The scope is public, to open up tcp Agreed 6379 port , Always working :
firewall-cmd --zone=public --add-port=6379/tcp --permanent
8. Update firewall rules
firewall-cmd --reload
9. Check redis Running state
docker ps

10. Test connection

边栏推荐
- How Bi makes SaaS products have a "sense of security" and "sensitivity" (Part I)
- One month soft test | experience sharing of intermediate test for software designers (with learning materials)
- 二叉树链式结构
- Navicat tool batch imports JSON format data to Doris
- Sectigo certificate price
- 20、ADS使用记录之E类功放设计(上)
- (10.3)【隐写缓解】隐写防护、隐写干扰、隐写检测
- Binary tree chain structure
- S系列·删除文件夹的几种姿势
- [Tianyi cup 2021]esay_ eval
猜你喜欢

2022.6 download and installation tutorial of the latest version of mongodb
![[1037. effective boomerang]](/img/e2/ccac2e7df2db316da4e88bdc709e6e.png)
[1037. effective boomerang]

Navicat tool batch imports JSON format data to Doris

How Bi makes SaaS products have a "sense of security" and "sensitivity" (Part I)

Explain sentinel fusing strategy, degradation rules and flow control

Summary of 14 anomaly detection methods

Don't miss | quota management and application - bank credit card behavior scoring (see for practical operation)

20、ADS使用记录之E类功放设计(上)

How does the technical leader bring down a team?

27 | 关于高水位和Leader Epoch的讨论
随机推荐
飞书要不要做生态?剖析第一家 All in 飞书的独立 SaaS 案例
关于#数据库#的问题:请问vba+sql用select * from A where name1 regexp '护',错误提示“操作符丢失”
One article will help you understand SSR
Mp4 structure
CNI iproute2 API
Mysql database connection query join principle
I'm sorry if I don't understand. The final battle
Explain sentinel fusing strategy, degradation rules and flow control
Comment le modèle de diffusion a - t - il commencé à surpasser le Gan dans le domaine de la génération d'images?
蓝桥杯_丢番图方程
[FBCTF2019]RCEService
Golang of knowledge sharing -- a function based on whether a folder exists and whether a file exists
Doris daily function summary I
CVE-2022-30525漏洞複現
Senior learning long talk about programmers
Gunicorn 20.0.4 request smuggling vulnerability
Force deduction solution summary 1037- effective boomerang
[understanding of opportunity -22]: Guiguzi - the art of closing Tibet. Collect your talents in time to protect yourself in the workplace, business and business activities
编写循环何条件任务
Write cycle condition task