java技術(shù)研究

          統(tǒng)計

          留言簿(3)

          閱讀排行榜

          評論排行榜

          ngxin和tomcat集群不完全配置

          ngxin需要增加如下配置和tomcat的session復(fù)制配合使用
          proxy_redirect off; 
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header  Host $host;

          tomcat集群配置:
          <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                           managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                           expireSessionsOnShutdown="false"
                           useDirtyFlag="true"
                           notifyListenersOnReplication="true">
          <Membership 
          className="org.apache.catalina.cluster.mcast.McastService"
          mcastAddr="228.0.0.4"
          mcastPort="45564"
          mcastFrequency="500"
          mcastDropTime="3000"/>
          <Receiver 
          className="org.apache.catalina.cluster.tcp.ReplicationListener"
          tcpListenAddress="192.168.1.199"http://這里配置局域網(wǎng)IP
          tcpListenPort="4001"
          tcpSelectorTimeout="100"
          tcpThreadCount="6"/>
          <Sender
          className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
          replicationMode="pooled"
          ackTimeout="15000"
          waitForAck="true"/>
          <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
            filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
            
          <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
           tempDir="/tmp/war-temp/"
           deployDir="/tmp/war-deploy/"
           watchDir="/tmp/war-listen/"
           watchEnabled="false"/>
           
          <ClusterListener className="org.apache.catalina.cluster.session.ClusterSessionListener"/>
          </Cluster>

          web.xml最下面加上這句話
           <distributable/> 

          posted on 2014-03-28 16:14 小秦 閱讀(349) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 平谷区| 海安县| 宝鸡市| 安宁市| 山东省| 慈溪市| 延安市| 紫阳县| 黄冈市| 曲沃县| 蒙阴县| 游戏| 巴彦淖尔市| 嘉义市| 鲜城| 凤冈县| 科尔| 赤城县| 中阳县| 航空| 鲁甸县| 西林县| 江西省| 平利县| 云霄县| 安泽县| 石渠县| 五莲县| 红桥区| 宁都县| 神木县| 宝应县| 大足县| 阳泉市| 惠来县| 喀喇沁旗| 罗源县| 陆丰市| 墨竹工卡县| 固阳县| 定南县|