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

  • 相关阅读:
    Samba 基础搭建
    HBuilder 打包流程和遇到的坑
    js 字符串查找相同字母最长子串
    web前端简单的H5本地存储
    rem响应式JS
    JS洗牌算法
    Js 常用正则表达式
    JS_DOM_鼠标、键盘事件合集
    SE 2014年4月3日
    SE 2014年4月2日
  • 原文地址:https://www.cnblogs.com/reyinever/p/10041364.html
Copyright © 2011-2022 走看看