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

  • 相关阅读:
    MySQL之存储引擎
    MySQL之触发器
    MySQL之存储过程
    MySQL之自定义函数
    MySQL之视图
    三种方式安装mariadb-10.3.18
    Linux创建智能DNS
    CentOS 7 搭建Cobbler实现自动化安装系统
    搭建PXE实现自动化安装系统
    编译安装dropbear
  • 原文地址:https://www.cnblogs.com/reyinever/p/10041364.html
Copyright © 2011-2022 走看看