03、redis sentinel 测试实验

本文档详细介绍了如何进行Redis Sentinel的配置和启动,包括主从节点的设置,Sentinel配置文件的创建,以及Sentinel节点的启动和验证过程。通过这些步骤,可以实现Redis高可用性的监控和故障转移。
摘要由CSDN通过智能技术生成

安装参考:https://blog.csdn.net/EVISWANG/article/details/94553100

1、配置文件:

   主节点配置:

       cat redis-7000.conf

       port 7000

       daemonize yes

       pidfile  /var/run/redis-7000.pid

       logfile "7000.log"

       dir  /opt/redis/data

    从节点配置:

       [root@centos03ms config]# sed "s/7000/7001/g"  redis-7000.conf >redis-7001.conf

       [root@centos03ms config]# cat redis-7002.conf

 

       port 7002

       daemonize yes

       pidfile  /var/run/redis-7002.pid

       logfile "7002.log"

       dir  /opt/redis/data

       slaveof  127.0.0.1 7000

 

       [root@centos03ms config]# cat redis-7001.conf

       port 7001

       daemonize yes

       pidfile  /var/run/redis-7001.pid

       logfile "7001.log"

       dir  /opt/redis/data

       slaveof  127.0.0.1 7000

 

2、启动主从节点:

      [root@centos03ms config]# redis-server redis-7000.conf

      [root@centos03ms config]# redis-server redis-7001.conf

      [root@centos03ms config]# redis-server redis-7002.conf

      [root@centos03ms config]# ps -ef |grep redis

      root     19874     1  0 00:11 ?        00:00:00 re

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值