Liferay JBoss Master/Slave Failover Mode Configuration
1Prepare software
1.1Apache 2.2 httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
1.2LF JBoss(2 instances)
1.3mod_jk.so tomcat-connectors-1.2.37-windows-i386-httpd-2.2.x.zip
2mod_jk.so
2.1Rename to mod_jk.so and copy to %APACHE_HOME%/modules directory
2.2Load the mod_jk.so connector
Modify %APACHE_HOME%/conf/httpd.conf file, add below line to bottom line.
LoadModule jk_module modules/mod_jk.so
2.3Configure mod_jk for cluster nodes.
Modify “httpd.conf” file, add below lines to bottom line.
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkMount /* loadbalancer
2.4Need to create a file named workers.properties in conf directory. And add below lines in it.
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# Define Master
worker.master.host=10.25.153.107
worker.master.port=8009
worker.master.type=ajp13
worker.master.lbfactor=1
worker.master.cachesize=10
worker.master.cache_timeout=600
worker.master.socket_timeout=5
worker.master.recycle_timeout=20
worker.slave.prepost_timeout=1
worker.master.recovery_options=0
worker.master.connection_pool_timeout=5
worker.master.ping_mode=A
worker.master.ping_timeout=500
worker.master.connect_timeout=500
# Define prefered failover node for master
worker.master.redirect=slave
# Define Slave
worker.slave.host=127.0.0.1
worker.slave.port=8009
worker.slave.type=ajp13
worker.slave.lbfactor=1
worker.slave.cachesize=10
worker.slave.cache_timeout=600
worker.slave.socket_timeout=60
worker.slave.recycle_timeout=100
worker.slave.prepost_timeout=50
worker.slave.recovery_options=0
worker.slave.connection_pool_timeout=60
worker.slave.ping_mode=A
worker.slave.ping_timeout=20000
worker.slave.connect_timeout=20000
#Disable slave for all requests except failover
worker.slave.activation=disabled
# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=master,slave
worker.loadbalancer.sticky_session=1
# Status worker for managing load balancer
worker.status.type=status
3Configure JBoss to Cluster node.
3.1In file standalone/configuration/standalone.xml, add content as grew part below
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" instance-id="master" native="false">
<configuration>
<jsp-configuration development="true"/>
</configuration>
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
<virtual-server name="default-host" enable-welcome-root="false">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
3.2Add interface for specific ip
Add gray part as below, and change xxx.yyy.aaa.bbb to your jboss server ip.
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
<interface name="specific-ip-interface">
<inet-address value=" xxx.yyy.aaa.bbb "/>
</interface>
</interfaces>
3.3Change below gray part according to the interface added above.
<socket-binding-group name="standard-sockets" default-interface="specific-ip-interface" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-native" interface="specific-ip-interface" port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http" interface="specific-ip-interface" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="specific-ip-interface" port="${jboss.management.https.port:9443}"/>
<socket-binding name="ajp" port="8009"/>
4Configure Portal portal-ext.properties
cluster.link.enabled=true
lucene.replicate.write=true
5Test cluster server
5.1Visit URL http://localhost, you will see apache server default page.
5.2Visit URL http://localhost/c/portal/login twice with two browsers, you will see
the same page which response by master node as below.
5.3Shut down master node, observe the page from salve node as below.
相关推荐
doc 博文链接:https://zpball.iteye.com/blog/948672
LIFERAY门户系统集群配置.pdf 详细介绍应用配置
Liferay Portal Liferay IDE
Liferay中的AUI框架,官方叫做Alloy,是一个UI超框架,能为浏览器的三方面,结构,风格和表现建立网络应用提供连续的简单的API。 它融合了三种设计语言:HTML, CSS 和 JAVA。 准确来说AUI是Liferay在YUI的基础上...
liferay portal 开发指南liferay portal 开发指南liferay portal 开发指南liferay portal 开发指南
打开Liferay IDE,Window-->Preferences-->Server-->Runtime Environment,点击右边Add…,在弹出的服务器选择里面选择Liferay,Inc-->Liferay v6.1 CE (Tomcat 7),请打“Create a new location server”打上勾。...
Liferay Themes[1].pdf Liferay+CMS系统培训.ppt Liferay+Portal+数据库介绍+.doc Liferay+权限管理.doc liferay-portal-5-2-systems-development-sample-chapter-5-managing-pages[1].pdf ...
liferay 超级学习文档 liferay 框架 java hibernate liferay 不用多说
Liferay is a different portal. 10分下载的, 打包5折提供下载. Part 1 Introduction to Liferay 1. Liferay is a different portal 2. Getting started with the Liferay development platform Part 2 Adding ...
Liferay Web内容管理指南Liferay
Liferay 6 入门教程
这是本人工作了2年有关liferay中的所有技术详细日记 很珍贵
liferay6.2开发指南liferay6.2开发指南.doc
liferay tune
liferay 二次开文档
liferay快速入门quickstart
全面的liferay表结构详细描述,为liferay开发提供支持
包括liferay的用户配置,系统接口,包括Liferay Portal 6 企业应用开发,Liferay 用户开发接口,Liferay+in+Action,Liferay 系统开发等
Liferay教程
liferay文档 给初学liferay的人