zoukankan      html  css  js  c++  java
  • nginx负载均衡 ->Tomcat8集群 -> sentinel集群 -> redis3主从

    真个架构流程请草考https://segmentfault.com/a/1190000009591087讲解的流程很清晰

    1.nginx负载均衡自己找文章即可

    2.tomcat集群共享单个redis实例

    增加commons-pool2-2.3.jar、jedis-2.7.3.jar、tomcat-redis-session-manager-master-2.0.0.jar到tomcat下lib文件夹;(百度云有已经写好的jar包)

    tomcat配置共享session,修改context.xml文件,增加下面

    <Valve className="com.naritech.nicole.gump.RedisSessionHandlerValve" />
    <Manager className="com.naritech.nicole.gump.RedisSessionManager"
    host="192.168.32.135"
    password="123456"
    port="6379"
    database="0"
    maxInactiveInterval="60"
    />

    3.tomcat集群共享session,通过集群sentinel集群管理主从redis实例

    https://www.cnblogs.com/LiZhiW/p/4851631.html

    tomcat通过sentinel配置共享session,修改context.xml文件,增加下面(注释上面)

    <Valve className="com.naritech.nicole.gump.RedisSessionHandlerValve" />
    <Manager className="com.naritech.nicole.gump.RedisSessionManager"
    sentinelMaster="mymaster"
    sentinels="192.168.32.136:26379,192.168.32.137:26379,192.168.32.138:26379"
    password="123456"
    maxInactiveInterval="60"/>
    </Context>

    注意:redis.conf  和 redis-sentinel.conf配置文件里面有个bind 127.0.0.1,修改成你的ip,如果是别注释的,也打开。

       都可以在同一台机器上配置,监听不同端口,复制配置文件,启动用不同的配置文件;

    redis服务相关命令 :    redis-server   /etc/redis.conf

                pkill   redis-server

    sentinel服务相关命令:redis-sentinel    /etc/redis-sentinel.conf    &  (加个&让他在后台运行)

              pkill   redis-sentinel

    tomcat启动:   /tomcat8.0.3/bin/start.sh

            /tomcat8.0.3/bin/shutdown.sh

    nginx启动:   cd  /nginx/sbin

            ./nginx  start

            ./nginx   stop

            ./nginx  -s reload

      

    mysql5.7安装

    https://blog.csdn.net/meiliangdeng1990/article/details/79317241

    主从分离(待研究)

     https://blog.csdn.net/wuyongde_0922/article/details/70655185

  • 相关阅读:
    前端页面适配的rem换算
    Win10远程桌面 出现 身份验证错误,要求的函数不受支持,这可能是由于CredSSP加密Oracle修正 解决方法
    ES5, ES6, ES2016, ES.Next: What's going on with JavaScript versioning?
    国内的Android SDK镜像
    虚拟串口VSPD破解版 亲测win10 64可用
    Mybatis : "less than" issue in Select annotations
    如何在MyBatis中优雅的使用枚举
    Adding a custom jar as a maven dependency
    Error: Invalid or corrupt jarfile
    使用Json让Java和C#沟通的方法
  • 原文地址:https://www.cnblogs.com/sss-justdDoIt/p/9082918.html
Copyright © 2011-2022 走看看