Skip to content

Commit f8acac7

Browse files
committed
Added example of custom forests
1 parent 046a85e commit f8acac7

File tree

7 files changed

+53
-0
lines changed

7 files changed

+53
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This project shows an example of configuring any forests and replicas you'd like for a database. See
2+
the forests/custom-forest-example-content directory.
3+
4+
Note that you'll need to run this against a cluster with at least two nodes (failover requires three nodes, but you
5+
only need two nodes to see how ml-gradle will create replica forests).
6+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id "com.marklogic.ml-gradle" version "2.3.0-RC1"
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
mlHost=localhost
2+
mlAppName=custom-forest-example
3+
mlRestPort=8013
4+
mlUsername=admin
5+
mlPassword=admin
6+
mlContentForestsPerHost=1
7+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"database-name": "%%DATABASE%%"
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Starting in version 2.3.0 of ml-gradle, both mlDeploy and mlDeployCustomForests will process
2+
each directory under ./ml-config/forests. The directory can be named anything - but a good practice is
3+
to name it after the database for the forests, just to keep things simple.
4+
5+
Currently, only JSON files in the directories are supported. A JSON file may contain a single JSON object,
6+
defining a single forest, or it can contain an array of many JSON objects, each defining a single forest. This
7+
is a little different from how ml-gradle normally works, where the contents of a file match exactly what
8+
the Management REST API expects. But in this scenario, where it's common to have many forests that are all
9+
very similar in their configuration, it seemed worth supporting an array of objects to avoid creating a lot
10+
of different files.
11+
12+
Also, note that the custom forests all use "localhost". It's more common, in a large cluster, to specify
13+
the exact host so you have precise control over where each forest is created.
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"forest-name": "custom-forests-example-content-custom-1",
4+
"enabled": true,
5+
"host": "localhost",
6+
"database": "%%DATABASE%%"
7+
},
8+
{
9+
"forest-name": "custom-forests-example-content-custom-2",
10+
"enabled": true,
11+
"host": "localhost",
12+
"database": "%%DATABASE%%"
13+
}
14+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"forest-name": "custom-forests-example-content-custom-3",
3+
"enabled": true,
4+
"host": "localhost",
5+
"database": "%%DATABASE%%"
6+
}

0 commit comments

Comments
 (0)