Apache
load balancer without Glassfish cluster profile
Requirements
- Apache 2.2.x
- mod_proxy
- mod_proxy_balancer
- mod_rewrite
- Glassfish 2 ur2 +
Setup
Add the following to make Apache load balance to your Glassfish instances:
RewriteEngine On
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
<Proxy balancer://mycluster>
BalancerMember http://10.1.1.2:8080 route=w1
BalancerMember http://10.1.1.3:8080 route=w2
BalancerMember http://10.1.1.4:8080 route=w3
</Proxy>
<Location /clusterjsp>
Order allow,deny
Allow from all
</Location>
ProxyPass /clusterjsp balancer://mycluster/clusterjsp stickysession=JSESSIONID
Note the BalancerMember entries mentioned above. These are the separate
Glassfish instances you will need to install. Use the regular Glassfish install
and deploy the clusterjsp application with a /clusterjsp context root. Follow
the directions below for each separate Glassfish instance.
The Glassfish distribution contains an example application that allows you
to see how it works in a cluster. You will deploy this application since we are
still running the load-balancer. See
GLASSFISH_ROOT/samples/quickstart/clusterjsp.
Go to the administration console of your Glassfish installation. Click on
the Applications tab and click on Deploy, select the clusterjsp.ear file that
you found in the Glassfish samples directory. Then click OK. Then browse to
http://localhost/clusterjsp and see your work in action!
To make sure the session sticks you will have to set a JVM option, add the
following JVM option to your Glassfish instance so it knows it is running in an
Apache cluster setting:
-DjvmRoute=ROUTE
Note ROUTE needs to be the same as the route parameter
mentioned in the BalancerMember entries. I cannot stress this enough, make sure
that this setting matches up otherwise your sticky sessions will NOT work!
Once you are finished setting up all the instance continue on below,
otherwise repeat the same process for all the instances you want to setup.
You now have both Apache and the Glassfish instances configured so it is
time to check if the load-balancer is online. Browse to
http://localhost/balancer-manager (where localhost is your Apache server) and
verify if the load-balancer sees the 3 workers and if the routes are set.
Please send comments, suggestions and any feedback to sales@manorrock.com.
分享到:
相关推荐
工作录制,语言为成都方言 主要实际操作Flex远程对象实现
apache与glassfish整合,包含apache的安装与配置文件配置与属性说明,以及一个简易demo
flex远程对象操作(简单对象到复杂对象) 服务器为glassfish 工作过程录制,语言为成都方言:),听不明白的只有光看了
工作录制,语言为成都方言 主要实际操作Flex远程对象实现
Glassfish 与 Apache 的整合 不多说自己看 会有收获的
glassfish和ant安装与配置 在eclipse中的配置
LearningRoom jsp新手开发小案例;开发环境,netbeans+glassfish+postgresql+jsp(java8)
GlassFish Server 是Java EE的开源参考实现
NetBeans8 0 2+GlassFish4 1 或者WildFly 8 0 2 +MySQL5 6 23 也可以稳步到这里一坐:http: tryrefine iteye com blog 2184106">Java EE 7官司方例子 也是《Java EE 7 Essentials》(中文翻译《Java EE 7精粹》 ...
Java EE 7已经发布很久了,新增加了很多新的功能和特性,如新增或更新了不少的JSR标准。其中特别受到关注的是Websockets。它的一个好处之一是减少了不必要的网络流量。它主要是用于在客户机和服务器之间建立单一的...
在安装了CentOS系统的情况下如何安装web服务器应用软件 如:apache、tomcat、glassfish、nfs、heatbeat等 本指南是本人在安装过程中进行整理的如有不详,或不清楚的地访请谅解,也可联系我
glassfish配置jndi(DB2数据库)的详细步骤,注意在步骤2时需要修改数据源名称
glassfish 安装构建在windows 中自动启动服务。
glassfish-v2.1.1-b31g-src based on the Java EE 5 standard
详细介绍glassfish安装过程。ant 工具的使用!!
glassfish集群搭建手册glassfish集群搭建手册glassfish集群搭建手册
GlassFish4的下载和安装的详细步骤,下载地址,配置等。附带有GlassFish3的安装简述
glassfish.part2
Glassfish 集群技术揭秘Glassfish 集群技术揭秘
Glassfish部署web项目