-
Notifications
You must be signed in to change notification settings - Fork 66
Database Configuration
In deploy/ml-config.xml, you will find XML describing the content and modules databases, along with placeholders for triggers, schemas, and the test-content database.
Database settings are configured by adding the appropriate element as a child to the database element. For instance, to turn on the URI lexicon, have this in as a direct child of the database element:
<uri-lexicon>true</uri-lexicon>
This can be done with any database property. Refer to MarkLogic's databases.xml file to see the format. NOTE: do not manually edit databases.xml -- you will likely mess up your server.
To make the setting dependent on the environment, set it with a property instead of hard-coding a value.
<uri-lexicon>@ml.uri-lexicon</uri-lexicon>
If you do this, you must define the property in build.properties so that it is available for every environment. If you don't, the property name won't get substituted and bootstrapping will error for settings that require booleans or numbers (because "@ml.uri-lexicon" is not a valid boolean). It might seem to work for settings that take strings, but might not work as you expect. Define the property in build.properties, then override as needed in the {env}.properties files.
Examples are provided in ml-config.xml to help you define indexes. You can also run the following command, which will build and index based on your answers to a series of questions:
ml index
There are two ways to configure forests for the content database.
In deploy/default.properties, the content-forests-per-host property is set to 1. When deploying to a cluster, this property will control how many content database forests are built for each host in the target host's group.
To specify the forest data directory, add a db:database/db:forests/db:data-directory element with the path to the data directory. For example:
<databases xmlns="http://marklogic.com/xdmp/database" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://marklogic.com/xdmp/database database.xsd">
<!--Application Database Configuration-->
@ml.test-content-db-xml
<database>
<database-name>@ml.content-db</database-name>
<forests-per-host>@ml.content-forests-per-host</forests-per-host>
@ml.schemas-mapping
@ml.triggers-mapping
<forests>
<data-directory>/space/Forests/</data-directory>
</forests>
<!-- etc... -->
</database>
</databases>
If deploying to a cluster, be sure that the data directory exists and is writable by MarkLogic on all hosts.
TODO