java技術研究

          統計

          留言簿(3)

          閱讀排行榜

          評論排行榜

          ngxin和tomcat集群不完全配置

          ngxin需要增加如下配置和tomcat的session復制配合使用
          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://這里配置局域網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)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 肇源县| 峨眉山市| 盖州市| 乡宁县| 卓资县| 宝兴县| 遂川县| 广安市| 东丰县| 治多县| 托克逊县| 康平县| 龙岩市| 桑植县| 双柏县| 年辖:市辖区| 绥阳县| 化州市| 尼木县| 宜阳县| 睢宁县| 唐海县| 嘉黎县| 郎溪县| 文安县| 田林县| 密山市| 洛隆县| 饶阳县| 内江市| 邯郸县| 湖州市| 嵩明县| 孟连| 舞阳县| 五指山市| 临沧市| 麻阳| 英吉沙县| 鸡西市| 太原市|