Apache+jboss Cluster load Balancing based on reverse proxy (reprint)

Source: Internet
Author: User
Tags jboss jboss server

Assume that the three machine IP is 172.29.128.100, 172.29.128.101, 172.29.128.102, all 32Bit Windows XP system, respectively installed Apache2.2, Jboss-4.2.3.ga, Jboss-4.2.3.ga.

The schema that will be deployed is as follows:

Apache (172.29.128.100)

|

JBoss Cluster

|

//

/    /

/        /

JBoss JBoss

       (172.29.128.101)      (172.29.128.102) Add < to Web.xml file in Web application distributable/> Add jboss-web.xml files to the Web application (under the same folder as Web.xml), as follows: View plain copy to clipboard print? < Jboss-web >        < replication-config >       & nbsp;    < Replication-trigger > set_and_non_primitive_get            </Replication-trigger >        < replication-granularity >                 SESSION       </replication-granularity >         < replication-field-batch-mode >                 True       </replication-field-batch-mode >         </replication-config >    </jboss-web >    <jboss-web> & Lt;replication-config> <replication-trigger>set_and_non_primitive_get </replication-trigger> < replication-granularity> session </replication-granularity> <replication-field-batch-mode> True < /replication-field-batch-mode> </replication-config> </jboss-web> put the application into a war package on 101 and 102 Jboss-4.2.3.ga/server/all/deploy under

Configuring the JBoss cluster: Create a new Run_all.bat file under Jboss-4.2.3.ga/bin 101 and 102, respectively: Run.bat-c all-b 172.29.128.101, Run.bat-c all-b 172.29.128.102 (This step must be done, otherwise can not implement session replication) modify Jboss-4.2.3.ga/server/all/deploy/jboss-web.deployer/server.xml file, will address= "${JBoss. Bind. adress} "${JBoss. Bind. Adress} is replaced with the IP of the JBoss server. Find <engine name= "jboss.web" defaulthost= "localhost" >, change 101 to <engine name= "jboss.web" defaulthost= "localhost" "Jvmroute=" Node1 >, 102 changed to <engine name= "jboss.web" defaulthost= "localhost" jvmroute= "Node2" > Modify Jboss-4.2.3.ga/server/all/deploy/jboss-web-cluster.sar/meta-inf/jboss-server.xml, Comment <config><udp Mcast_addr ..., let go of <config><tcp mcast_addr ..., change all down_thread= "false" up_thread= "false" to down_thread= "true" up _thread= "true". Find Initial_host= "..., change 101 to Initial_hosts=" 172.29.128.101[7810],172.29.128.102[7810] "and 102 to Initial_hosts=" 172.29.128.102[7810],172.29.128.101[7810] "Start 101 JBoss, start 102 after the success of JBoss

Configure load Balancing

Modify the Apache httpd.conf and release the comments before the following modules:

LoadModule Proxy_module modules/mod_proxy.so

LoadModule Proxy_ajp_module modules/mod_proxy_ajp.so

LoadModule Proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule Proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so

Add in httpd.conf:

Proxyrequests off

Proxypass/yourproname balancer://172.29.128.100

<proxy balancer://172.29.128.100>

Balancermember ajp://172.29.128.1018009/yourproname route=node1 loadfactor=50

       Balancermember Ajp://172.29.128.102:8009/yourproname Route=node2 LOADFACTOR=50 </Proxy> start Apache, enter Http://172.29.128.100/yourProName

in the browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.