zoukankan      html  css  js  c++  java
  • redis:sentinel监控服务器

    1. Sentinel工具完成监控--操作步骤

    (1)redis解压包中的sentinel.conf拷贝到redis的安装目录下:

    [root@192 redis]# cp /opt/redis-4.0.11/sentinel.conf ./

    (2)修改配置文件sentinel.conf,修改内容如下:

    [root@192 redis]# vi sentinel.conf

    #sentinel monitor mymaster 127.0.0.1 6379 2

    sentinel monitor mymaster 127.0.0.1 6379 1

    sentinel down-after-milliseconds mymaster 30000

     

    (3)启动redis服务

    [root@192 redis]# ./bin/redis-server ./redis.conf

    [root@192 redis]# ./bin/redis-server ./redis6380.conf

    [root@192 redis]# ./bin/redis-server ./redis6381.conf

    (4)启动sentinel监控:

    [root@192 redis]# ./bin/redis-server ./sentinel.conf --sentinel

    (5)master宕掉:

    127.0.0.1:6379> shutdown

    (6)查看sentinel监控的变化

    (7)查看从服务器的变化

    127.0.0.1:6380> info replication

    # Replication

    role:master

    connected_slaves:1

    slave0:ip=127.0.0.1,port=6381,state=online,offset=38168,lag=0

    127.0.0.1:6381> info replication

    # Replication

    role:slave

    master_host:127.0.0.1

    master_port:6380

    master_link_status:up

  • 相关阅读:
    洛谷 P1443 马的遍历
    括号序列 (自出水题)
    19年清北学堂冬令营游记
    计数排列(模板)
    全排列
    unique去重
    链表 模板+详解
    输入输出优化
    关于广/宽度优先搜索
    第四周 6.7-6.13
  • 原文地址:https://www.cnblogs.com/reyinever/p/10041364.html
Copyright © 2011-2022 走看看