Dashboard > Community Wiki Archive > Home > Setting up a MySQL repository
Setting up a MySQL repository Log In View a printable version of the current page.

Added by GrĂ©gory Joseph , last edited by GrĂ©gory Joseph on Jul 15, 2008  (view change)
Labels: 

There are a bunch of pages related to Mysql. If someone wants to volunteer and merge them, that'd be much appreciated.

MySQL Persistence (Community Wiki)
Labels: v3_5, jackrabbit, mysql, installation, config, persistence
Setting up a MySQL repository (Community Wiki Archive)
Labels: outdated, mysql, persistence, deployment
Using Mysql with Magnolia 2.1.5 (Community Wiki Archive)
Labels: v2_1, mysql, deployment, persistence

TODO: Fix some markup.

From: Stephen Starkey <user-list@magnolia.info>	Mailed-By: magnolia.info
Reply-To: user-list@magnolia.info
To: user-list@magnolia.info
Date: Jun 29, 2006 1:14 AM
Subject: [magnolia-user] Solution: Difficulties setting up Magnolia (with MySQL)

For those who have attempted to use a remote database before, there is
actually a much more complicated solution for 3.0 than has been
presented by others..

My fears were well-founded, it turns out ..

Nowhere is it documented that the war files are prepackaged with a
magnolia/repositories/magnolia/* directory that has all the repository
paths hard-coded to the derby repository. Also, the bootstrap files for
both magnoliaPublic.war and magnoliaAuthor.war both make the repository
into an admin repository when you rebuild it, instead of
magnoliaPublic.war making the repository into a public one, and
magnoliaAuthor.war making it into an admin one.

So, until the war files are packaged such that the bootstrap directories
are used to generate the repositories for the first time, we must do the
following...

First, remove:

  • webapps/magnoliaAuthor/repositories/magnolia
  • webapps/magnoliaPublic/repositories/magnolia

Then, change:

  • webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-mysql-search.xml and
  • webapps/magnoliaPublic/WEB-INF/config/repo-conf/jackrabbit-mysql-search.xml

To have two distinct mysql databases (I used magnolia_author and magnolia_public)

Then, change:

  • webapps/magnoliaAuthor/WEB-INF/config/default/repositories.xml and
  • webapps/magnoliaPublic/WEB-INF/config/default/repositories.xml

To use the jackrabbit-mysql-search.xml instead of jackrabbit-derby-search.xml

Then, change:

  • webapps/magnoliaPublic/WEB-INF/bootstrap/common/config/config.modules.adminInterface.virtualURIMapping.default.xml

To have the "toURI" property to be set to "/help" instead of
"/.magnolia/adminCentral.html"

Then, change:

  • webapps/magnoliaPublic/WEB-INF/bootstrap/author/config/config.server.xml

To have the "admin" property to be set to "false" instead of "true"

Then, remove 1 :

  • webapps/magnoliaPublic/WEB-INF/bootstrap/author/config/config.server.secureURIList.root.xml

(this will cause an exception to occur the first time the app is started
up because there is no secureURIList, which is fine for a public site's
default configuration.. perhaps there's a better way to do this..)

Then, copy your mysql-connector-java-x.x.x.jar into each of the
magnolia*/WEB-INF/lib directories 2 .

THEN

Start up Tomcat, which will recreate the two repositories based off the
properly configured data in the bootstrap directories, storing the data
for each in the appopriate database. To configure the public instance
directly, use http://localhost:8080/magnoliaPublic/.magnolia

If there are any developers reading this, please let me know if I've
missed anything. This particular configuration works out-of-the box for
us, so I recommend the war files be changed appropriately.


Correction:

Do NOT delete this file:

webapps/magnoliaPublic/WEB-INF/bootstrap/author/config/config.server.sec
ureURIList.root.xml

Instead, you have two choices:

  1. If you prefer to have the default behavior of your public site secure, then leave it alone. It can be tweaked after the repository is built.
  2. If you prefer to have it be un-secured by default, simply modify the URI property to be /.magnolia* instead

There is no need to copy the JDBC driver into both these locations. Simply copy it into $CATALINA_HOME/common/lib.

Also, now is a good time to increase the heap size for your JVM. The default of 64Mb will not be sufficient. Do this by creating the following environment variable:

JAVA_OPTS="-Xms64m -Xmx256m"

I just pulled 256Mb out of thin air and haven't tested it yet.


You can alternatively use the DataSourcePersistenceManager which will use the connection pooling of Tomcat. Indeed, the jackrabbit MySQL PersistenceManager uses only one connection to MySQL, which causes some "Broken Pipe" error and could possibly loose some data.
Read the mailing list history for more information – AnthonyOgier


There are some additional changes that is essential for configuring version 3.0.3 with MySQL. They are
a. Open \WEB-INF\config\default\magnolia.properties and edit the property magnolia.repositories.jackrabbit.config. Set it to WEB-INF/config/repo-conf/jackrabbit-mysql-search.xml

b. If the MySQL User Account needs a password, then you will have to remove the comments in the XML within the repo-conf\jackrabbit-mysql-search.xml file. Change the line
<!-- <param name="password" value="magnolia"/> -->
to
<param name="password" value="magnolia"/>

Please note that the same changes have to done within author and public instances.

Hari


In its previous incarnation on JspWiki, this page was last edited on Oct 4, 2007 10:57:34 AM by Hari
Other known authors include :

  • FerrisNicolaisen
  • Magnolia
  • AnthonyOgier
Powered by a free Atlassian Confluence Open Source Project License granted to Magnolia International. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators