本网站可以通过分类标签帮助你快速筛选出你想看的文章,记住地址:www.Facec.cc

redis主从复制集群搭建

设置三个redis配置文件

  1. redis.conf
  2. redis6380.conf (主机器)
  3. redis6381.conf (从)
  4. redis6381.conf (从)

配置redis6380.conf

include redis.conf
pidfile	/var/run/redis_6380.pid
port 6380
dbfilename "appendonly6380.aof"
cluster-enabled yes 打开集群模式

// 设置优先级  越小优先成为master
replica-priority 100

运行

// 进入6381机器
redis-server redis6381.conf

// 选定机器作为master
slaveof 127.0.0.1 6380

// 查看6380机器的信息
info replication

20221011 84046.JPG

# redis  

评论