zoukankan      html  css  js  c++  java
  • 部署redis集群需要注意的点

      在虚拟机上安装多个redis,在redis.conf配置文件中,做以下修改

    protected-mode no (yes改为no)

    如果是一台虚拟机上启动多个redis服务,则我在/etc下复制redis.conf并重命名为redis6380.conf

      在配置中,

    1.pidfile "/var/run/redis6380.conf"

    2.port 6380

    3.logfile "6380.log"

    4.dbfilename "dump6380.rdb"

    5.protected-mode no

    启动redis:redis-server /etc/redis6380.conf

    客户端访问:redis-cli -p 6380 -h 主机ip

    设置一个主节点:在客户端中 slaveof 主机ip 端口号

    添加哨兵模式,在/etc在添加一个sentinel.conf ,里面写

    protected-mode no

    sentinel monitor (监视者名,这里为 mymaster)  主节点ip 端口号  (投票达标数,这里为 2)

    注意防火墙

    在springboot的配置中写

    #redis配置
    spring.redis.sentinel.master=mymaster
    spring.redis.sentinel.nodes=(哨兵主机ip):26379

  • 相关阅读:
    其他标签
    数组和全局变量
    字符串处理
    运算符
    PHP安装配置工具
    String、StringBuffer与StringBuilder之间区别
    mybits——1
    异常
    ubuntu 系统错误:Error : BrokenCount > 0解决
    ubuntu配置VScode
  • 原文地址:https://www.cnblogs.com/psxfd4/p/11854226.html
Copyright © 2011-2022 走看看