Databases Reference
In-Depth Information
4. Now, replace the same file in the other node and change the
id
attribute
of the
cluster
tag to
node_2
.
5.
Restart both the Liferay Portal nodes one by one.
In the preceding configuration, we first enabled the JCR store for Media Library.
This change will internally use Jackrabbit to store the Media Library content. By
default, configuration of Jackrabbit is stored in the
repository.xml
file. By default,
the Jackrabbit configuration stores the Media Library content in the data folder. We
configured the
repository.xml
file to store content in the same
lportal
database.
We can also configure the
repository.xml
file such that it stores the Media Library
content in a separate database. Jackrabbit internally divides the Media Library data
into the following types of data in the database:
• Repository-filesystem-related data
• Workspace-related data
• Versioning-related data
• Cluster-related data
We configured the
repository.xml
file such that the preceding data is stored in
the database.
Database storage using DBStore
Liferay Portal 6.1 introduced a new type of repository store to persist Media Library
content in the Liferay database. It is very simple to configure and provides better
performance than the JCR store with the database. Let's learn how to configure
Media Library to use
DBStore
.
1.
Stop both the Liferay Portal nodes if they are already running.
2.
Edit
portal-ext.properties
of both the nodes and add the following
configuration:
dl.store.impl= com.liferay.portlet.documentlibrary.store.DBStore
3.
Restart both the Liferay Portal nodes one by one.
Media Library clustering best practices
We talked about two options to centralize Media Library content storage. In
Chapter 1
,
Architectural Best Practices
, we briefly talked about other options too.
Let's talk about some of the best practices related to Media Library.
• In a clustered environment, the filesystem-based Media Library store
can only be used with SAN or NFS that supports file locking.