Liferay 6.1 and JBOSS 7.0

advertisement
Liferay 6.1 + Jboss 7.0.x Setup and Clustering Notes
MySQL Connector and Datasource Setup
- under <liferay_home>/jboss-7.0.1/modules, create a mysql/jdbc/main folder structure.
- place the mysql-connector-java.jar file there under 'main', the last folder.
- create a module.xml with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="mysql.jdbc">
<resources>
<resource-root path="mysql-connector-java-5.1.18-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
- under <liferay_home>/jboss-7.0.1/standalone/configuration,
add the following to standalone.xml:
<driver name="MySqlJDBCDriver" module="mysql.jdbc"/> under the <drivers> element
and under the <datasources> element, add:
<datasource jndi-name="java:/mysqldsjdni" pool-name="mysqlds_Pool" enabled="true"
jta="true" use-java-context="true" use-ccm="true">
<connection-url>
jdbc:mysql://mysql02.ausnq.com:3306/<dbname>?useUnicode=true&characterEncodi
ng=UTF-8&useFastDateParsing=false&emulateLocators=true
</connection-url>
<driver>
MySqlJDBCDriver
</driver>
<security>
<user-name>
<database username here>
</user-name>
<password>
<database password here>
</password>
</security>
</datasource>
- Also modify the <interfaces> element to allow outside connections:
<interface name="management">
<any-ipv4-address/>
</interface>
<interface name="public">
<any-ipv4-address/>
</interface>
Configuration for Liferay
- In the <liferay_home>/portal-ext.properties file, add the following to use the jboss mysql
datasource:
jdbc.default.jndi.name=MySqlDS
- Add the following in <liferay_home>/jboss-7.0.1/standalone/configuration/standalone.xml,
under the <security-domains> element:
<security-domain name="PortalRealm">
<authentication>
<login-module code="com.liferay.portal.security.jaas.PortalLoginModule"
flag="required"/>
</authentication>
</security-domain>
- Add to the jboss-deployment.structure.xml, in the <dependencies> element in the
ROOT.war/WEB-INF/ folder,
<module name="org.jboss.ironjacamar.jdbcadapters"/>
- in the standalone.xml, in the <deployment-scanner> element, modify the deployment-timeout
attribute:
<deployment-scanner name="default" path="deployments" ...other attributes...
deployment-timeout="240" />
- Under <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">,
add:
<connector name="ajp" protocol="AJP/1.3" socket-binding="ajp"/>
- Under <socket-binding-group name="standard-sockets" default-interface="public">, add:
<socket-binding name="ajp" port="8009"/>
- Under <liferay_home>/<jboss server>/standalone/deployments
- add blank files with the following names:
- ROOT.war.dodeploy
- tunnel-web.war.dodeploy
- (could add more .dodeploy files for the other portlets, etc,
but the above are the ones for a basic liferay 6.1 install)
LifeRay 6.1 + Jboss 7.0.1 Clustering
- Copy the above liferay node to be node 2 (rename the above setup node to be node1, etc.)
- In node2: the standalone.xml file, modify the <socket-binding-group> element and all the
<socket-binding> sub-elements
to have ports that have been increased by 100.
- E.g. - <socket-binding name="http" port="8080"/> to <socket-binding name="http"
port="8180"/>
- And so on.
- In node2: the standalone.xml file, modify the sub-elements under the <managementinterfaces> element
to have ports increased by 100.
- E.g. - <native-interface interface="management" port="9999"/> to <native-interface
interface="management" port="10099"/>
- For both node1 and node2:
- Copy all the above port changes in the standalone.xml to standalone-ha.xml.
- Change the default-stack="udp" attribute in the <subsystem
xmlns="urn:jboss:domain:jgroups:1.0"> element
to default-stack="tcp".
- (IGNORE! Probably a hold-over from the beta builds) Change the enable-welcome-root
attribute in the <virtual-server name="default-host"> element to "false
so that the entire element becomes: <virtual-server name="default-host" enablewelcome-root="false">
- Add deployment-timeout="240" attribute to the <deployment-scanner> element to prevent
deployments from timing out.
<deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir"
path="deployments" deployment-timeout="240"/>
- (Optional ? IGNORE ? )Also add, under the <subsystem xmlns="urn:jboss:domain:ee:1.0">
element in standalone.xml :
<global-modules>
<module name="com.liferay.portal" slot="main"/>
</global-modules>
- Below the extensions element (order may be important, so the following should be exactly
underneath it), add the following
to the standalone.xml:
<system-properties>
<property name="jvmRoute" value="ajp13-01" /> <!--(substitute the value
depending the node and on the setup for Apache - typically under the workers.properties if
using mod_ajp or in the mod_proxy_ajp.conf if using mod_proxy_ajp instead) -->
</system-properties>
- Add the <distributable /> element to the web.xml in
<jboss_server>/standalone/deployments/ROOT.war/WEB-INF
- Node 2: Increase the ports in the <socket-binding name="jgroups-tcp"> and <socket-binding
name="jgroups-tcp-fd" />
element by 1.
- in both node1 and node2 (<liferay_home>/<node #>/jboss/bin), add the following to the
"standalone.conf":
- to the JAVA_OPTS parameter at the final line: "-Djgroups.tcpping.initial_hosts=<ip
address>[7600],<ip address>[7601]"
- May need to start each node as ./standalone.sh –Dbind.address=<IP address of Server>
Observations
* May encounter a warning about session replication in logs(Failed to load session attributes for
session: S4....):
https://issues.jboss.org/browse/AS7-1901
* In the JBOSS 7 bundle, it appears that sessions time out after a minute. Does not seem to
happen with the Tomcat bundle.
- specific to the <distributable /> element in the ROOT.war/WEB-INF/web.xml ?
* Also in the JBOSS 7 bundle, there may be hibernate cache errors : "ERROR
[render_portlet_jsp:154] com.liferay.portal.kernel.exception.SystemException:
com.liferay.portal.kernel.dao.orm.ORMException:
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update"
with page updates across the cache.
* Have not seen this on the Tomcat instance, yet.
* Setting up clustering on Tomcat 7 is the same that it is on Tomcat 4.
* Oracle specific ? - Seems like there may be an issue with bulk image uploading in a clustered
Tomcat environment (java.lang.ArrayIndexOutOfBoundsException: 0 ?) ?? Not sure if this is
specific to Oracle.
* Issue with live.users.enabled=true feature:
- NullPointerException
- (Could be fixed by this ? -> )Also add, under the <subsystem
xmlns="urn:jboss:domain:ee:1.0"> element in standalone.xml :
<global-modules>
<module name="com.liferay.portal" slot="main"/>
</global-modules>
Download