当前位置:网站首页>Redis master-slave replication in win10 system

Redis master-slave replication in win10 system

2022-06-26 09:52:00 Southern Chu Lich

The article draws on the ideas of this blog , But there are some changes on the basis .
Reference blog :
https://blog.csdn.net/qq_42642549/article/details/108324143

First step :
open Redis The installation path : Copy three copies : Copy redis.windows.conf, They are called 6379、6380、6381, This is shown below .
 Insert picture description here
The second step :
Modify dependent profile :6380.conf、6381.conf Modify the port number in the file port and slaveof
port modify
6380 It is amended as follows port 6380
6381 It is amended as follows port 6381
 Insert picture description here
slaveof modify
slaveof 127.0.0.1 6379
 Insert picture description here
Remember here slaveof There must be no spaces in front of , Otherwise, an error will be reported .

The third step :
Because I tried to write a blog bat When you file , Garbled code will appear during execution , So I choose WIN+R Create the form of three command Windows , Generate 6379、6380、6381 Three windows . Absolute path startup is recommended .

6379
 Insert picture description here
6380
 Insert picture description here
6381
 Insert picture description here
Therefore, it indicates that the master-slave relationship is successful

Step four : Verify whether the master can read and write , Readable from .

In the original installation folder redis-cli.exe, Enter the command set name hopelei
 Insert picture description here
When starting the response segment command :
There will be NOAUTH The situation of , Here you need to enter your account and password , When clients on other ports start , That's what happens , The solution is the same .
 Insert picture description here
After shutting down the primary database , Open one here cmd Program , Enter the following command , Check whether the contents in the master database can be read from the slave database .
 Insert picture description here

Verify that the master-slave replication can exist .

原网站

版权声明
本文为[Southern Chu Lich]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260912224138.html