主从复制Redis集群

         Rancher搭建Redis主从集群

主从容器启动的时候指定不同的配置文件

        Rancher搭建Redis主从集群

         Rancher搭建Redis主从集群

         Rancher搭建Redis主从集群

#!/bin/bash

#change redis config
ordinal=`env | grep podname | cut -d"=" -f2 | cut -d"-" -f2`
sed -i "s/slaveof.*/slaveof rediscluster-0.rediscluster 6379/g" /etc/redis/redis-slave.conf
if [ $ordinal -eq 0 ]; then
   redis-server /etc/redis/redis-master.conf
else
   redis-server /etc/redis/redis-slave.conf
fi
View Code

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2022-01-07
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
猜你喜欢
  • 2021-06-29
  • 2021-06-22
  • 2022-12-23
  • 2021-06-23
  • 2021-05-31
  • 2021-08-08
相关资源
相似解决方案