单机创建Glassfish集群(apache jk)
2016-01-05 10:40
549 查看
环境说明:
Windows、jdk1.7、Glassfish4.1、apache2.2.25
创建集群
运行:asadmin
启动默认域:start-doamin
创建你的cluster:multimode -f commands.txt
配置apache(2.2.*)
将mod_jk.so放到moudles目录下
将如下片段添加到httpd.conf的尾部
将workers.properties放到conf目录下
重启apache
使用apache httpd 2.2.*作为前端进行带来配置,样例如下:
workers.properties样例如下:
到此,单机集群搭建完成,下面测试下,测试方法很简单,启动集群后轮流关闭实例,看看应用是否可访问。session复制问题,自己写个简单的jsp应用试试就好,懒得写可以把tomcat的那个关于session的改改就行。
注意web.xml中需要加入此条:
资料下载
Windows、jdk1.7、Glassfish4.1、apache2.2.25
创建集群
运行:asadmin
启动默认域:start-doamin
创建你的cluster:multimode -f commands.txt
create-cluster cluster1 create-local-instance --cluster cluster1 ins1 create-local-instance --cluster cluster1 ins2 create-local-instance --cluster cluster1 ins3 create-network-listener --protocol http-listener-1 --listenerport \${AJP_PORT} --target cluster1 --jkenabled true jk-connector create-jvm-options --target cluster1 "-DjvmRoute=\${AJP_INSTANCE_NAME}" create-system-properties --target ins1 AJP_PORT=28009 create-system-properties --target ins2 AJP_PORT=28019 create-system-properties --target ins3 AJP_PORT=28029 create-system-properties --target ins1 AJP_INSTANCE_NAME=ins1 create-system-properties --target ins2 AJP_INSTANCE_NAME=ins2 create-system-properties --target ins3 AJP_INSTANCE_NAME=ins3 list-clusters start-cluster cluster1
配置apache(2.2.*)
将mod_jk.so放到moudles目录下
将如下片段添加到httpd.conf的尾部
将workers.properties放到conf目录下
重启apache
使用apache httpd 2.2.*作为前端进行带来配置,样例如下:
LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # Send everything for context /clustWeb to worker named worker1 (ajp13) JkMount /* checc
workers.properties样例如下:
worker.list=checc worker.ins1.type=ajp13 worker.ins1.host=localhost worker.ins1.port=28009 worker.ins1.lbfactor=1 worker.ins1.socket_keepalive=1 worker.ins1.socket_timeout=300 worker.ins2.type=ajp13 worker.ins2.host=localhost worker.ins2.port=28019 worker.ins2.lbfactor=1 worker.ins2.socket_keepalive=1 worker.ins2.socket_timeout=300 worker.ins3.type=ajp13 worker.ins3.host=localhost worker.ins3.port=28029 worker.ins3.lbfactor=1 worker.ins3.socket_keepalive=1 worker.ins3.socket_timeout=300 worker.checc.type=lb worker.checc.sticky_session=1 worker.checc.balance_workers=ins1,ins2,ins3
到此,单机集群搭建完成,下面测试下,测试方法很简单,启动集群后轮流关闭实例,看看应用是否可访问。session复制问题,自己写个简单的jsp应用试试就好,懒得写可以把tomcat的那个关于session的改改就行。
注意web.xml中需要加入此条:
<distributable/>
资料下载
相关文章推荐
- windows下创建apache服务
- Apache Stratos探究:Pub-Sub 通信模式
- linux普通用户下安装apache、mysql、php
- Caused by: java.lang.ClassNotFoundException: org.apache.log4j.DefaultThrowableRenderer
- Apache编译安装
- Apache CXF 客户端调用 超时设置
- 关闭 Apache—DBUtils框架简介、DbUtils类、QueryRunner类 、ResultSetHandler接口
- Ubuntu下Apache中部署Django
- Apache cxf 整合 Spring MVC
- [转]五种开源协议的比较(BSD,Apache,GPL,LGPL,MIT)
- Apache James邮件服务器的简介及使用
- Apache无法启动解决方案
- Apache cloudera hortonworks 与cdh ambari cm hdp hadoop生态圈的关系
- Apache添加mime类型
- 四大开源协议:BSD、Apache、GPL、LGPL
- apache+php+mysql安装配置
- java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
- win7安装apache+php
- django+python+apache+生产服务器 部署
- 怎样设置Apache访问限制