P. 1
Liferay Administration Guide

Liferay Administration Guide

|Views: 574|Likes:
Publicado pornicolargo
THE administration guide provided by Liferay
THE administration guide provided by Liferay

More info:

Published by: nicolargo on Oct 09, 2009
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/20/2011

pdf

text

original

Liferay starting with version 5.2.3 supports database sharding for different portal
instances. Sharding is a term used to describe an extremely high scalability configura-
tion for systems with massive amounts of users. In diagrams, a database is normally

Performance Tuning

279

Enterprise Configuration

pictured as a cylinder. Instead, picture it as a glass bottle full of data. Now take that
bottle and smash it onto a concrete sidewalk. There will be shards of glass every-
where. If that bottle were a database, each shard now is a database, with a subset of
the data in each shard.

This allows you to split up your database by various types of data that might be
in it. For example, some implementations of sharding a database split up the users:
those with last names beginning with A to D go in one database; E to I go in another;
etc. When users log in, they are directed to the instance of the application that is con-
nected to the database that corresponds to their last names. In this manner, pro-
cessing is split up evenly, and the amount of data the application needs to sort
through is reduced.

By default, Liferay allows you to support sharding through different portal in-
stances, using the round robin shard selector. This is a class which serves as the default
algorithm for sharding in Liferay. Using this algorithm, Liferay will select from sever-
al different portal instances and evenly distribute the data across them.
Of course, if you wish to have your developers implement your own sharding al-
gorithm, you can do that. You can select which algorithm is active via the portal-ext.-
properties file:

shard.selector=com.liferay.portal.dao.shard.RoundRobinShardSelector
#shard.selector=com.liferay.portal.dao.shard.ManualShardSelector
#shard.selector=[your implementation here]

Enabling sharding is easy. You will need to make sure you are using Liferay's
data source implementation instead of your application server's. Set your various
database shards in your portal-ext.properties file this way:

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEn-
coding=UTF-8&useFastDateParsing=false
jdbc.default.username=
jdbc.default.password=
jdbc.one.driverClassName=com.mysql.jdbc.Driver
jdbc.one.url=jdbc:mysql://localhost/lportal1?useUnicode=true&characterEncod-
ing=UTF-8&useFastDateParsing=false
jdbc.one.username=
jdbc.one.password=
jdbc.two.driverClassName=com.mysql.jdbc.Driver
jdbc.two.url=jdbc:mysql://localhost/lportal2?useUnicode=true&characterEncod-
ing=UTF-8&useFastDateParsing=false
jdbc.two.username=
jdbc.two.password=
shard.available.names=default,one,two

Once you do this, you can set up your DNS so that several domain names point to
your Liferay installation (e.g., abc1.com, abc2.com, abc3.com). Next, go to the Control
Panel and click Portal Instances in the Server category. Create two to three instances
bound to the DNS names you have configured.
If you are using the RoundRobinShardSelector class, Liferay will automatically
enter data into each instance one by one, automatically. If you are using the Manu-

280

Performance Tuning

Enterprise Configuration

alShardSelector class, you will have to specify a shard for each instance using the UI.
The last thing you will need to do is modify the spring.configs section of your
portal-ext.properties file to enable the sharding configuration, which by default is com-
mented out. To do this, your spring.configs should look like this (modified section is
in bold):

spring.configs=\

META-INF/base-spring.xml,\
\
META-INF/hibernate-spring.xml,\
META-INF/infrastructure-spring.xml,\
META-INF/management-spring.xml,\
\
META-INF/util-spring.xml,\
\
META-INF/editor-spring.xml,\
META-INF/jcr-spring.xml,\
META-INF/messaging-spring.xml,\
META-INF/scheduler-spring.xml,\
META-INF/search-spring.xml,\
\
META-INF/counter-spring.xml,\
META-INF/document-library-spring.xml,\
META-INF/lock-spring.xml,\
META-INF/mail-spring.xml,\
META-INF/portal-spring.xml,\
META-INF/portlet-container-spring.xml,\
META-INF/wsrp-spring.xml,\
\
META-INF/mirage-spring.xml,\
\
#META-INF/dynamic-data-source-spring.xml,\

META-INF/shard-data-source-spring.xml,\

\

That's all there is to it. Your system is now set up for sharding.

Performance Tuning

281

7.

7. MMAINTAINING
AINTAINING A

A LLIFERAY

IFERAY PPORTAL
ORTAL

Maintaining a running implementation of Liferay Portal is not much different
from maintaining the application server environment upon which it is running. There
are, however, several factors which administrators should be aware of when they are
responsible for a running instance of Liferay. This chapter will cover these issues,
outlining for system administrators some specifics about keeping a running Liferay
instance stable and secure.
This chapter will cover the following topics:

Liferay Monitoring using Google Analytics

Backing Up a Liferay Installation

Changing Logging Levels

Upgrading Liferay
The discussion on back up will cover what parts of Liferay should be backed up.
We will not cover specific backup software or procedures; generally, most organiza-
tions have standards for doing backups of their systems, and Liferay as a Java EE ap-
plication fits well into these standards.

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->