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

  • 相关阅读:
    jQuery拾忆
    关于在审查元素中看到的::before与::after
    Spring MVC数据绑定
    最近要了解的
    MySql去重
    数据库去重与join连表
    Spring jdbcTemplate RowMapper绑定任意对象
    二十九、利用 IntelliJ IDEA 进行代码对比的方法
    二十八、详述 IntelliJ IDEA 远程调试 Tomcat 的方法
    二十七、详述 IntelliJ IDEA 设置 Sublime 代码颜色的方法
  • 原文地址:https://www.cnblogs.com/sss-justdDoIt/p/9082918.html
Copyright © 2011-2022 走看看