Skip to content

Commit b3005e0

Browse files
committed
#110 Using mlDatabaseNamesAndReplicaCounts
1 parent 1576164 commit b3005e0

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed
Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
11
plugins {
2-
id "com.marklogic.ml-gradle" version "2.2.0"
2+
id "com.marklogic.ml-gradle" version "2.2.0"
33
}
4-
5-
ext {
6-
myForestNamesAndReplicasCounts = [ "Security": 2, "Schemas": 1, "Meters": 1, "App-Services": 1]
7-
}
8-
9-
/*
10-
* The mlConfigureForestReplicas task exposes an instance of ConfigureForestReplicasCommand as the "command" attribute.
11-
* This allows us to easily modify the forestNamesAndReplicaCounts map, where each key is the name of a primary forest,
12-
* and the value of each key is the number of replicas to create on each host in the cluster (except the host that the
13-
* primary forest resides on).
14-
*
15-
* Note that this is usually most useful for supporting failover for MarkLogic apps such as Admin and App-Services. For
16-
* failover for your own forests, you can use this approach, but you may also wish to create forest config files under
17-
* src/main/ml-config/forests.
18-
*/
19-
mlConfigureForestReplicas.command.forestNamesAndReplicaCounts = myForestNamesAndReplicasCounts
20-
21-
/*
22-
* mlDeleteForestReplicas can then use the same map as mlConfigureForestReplicas, as it will delete replicas for all of
23-
* the forests identified by the keys in the map. This task could be called before mlUndeploy, for example, to first
24-
* delete all of the forest replicas, thus allowing the primary forests to be deleted safely.
25-
*/
26-
mlDeleteForestReplicas.command.forestNamesAndReplicaCounts = myForestNamesAndReplicasCounts

examples/failover-project/gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ mlRestPort=8013
44
mlUsername=admin
55
mlPassword=admin
66

7-
mlDatabaseNamesAndReplicaCounts=Security,1,Schemas,2
7+
# The following configuration property lets you easily define how many replicas you want of the forests
8+
# for each database. For more precise control over forests and replicas, look into DeployCustomForestsCommand
9+
# and DeployCustomForestsTask.
10+
mlDatabaseNamesAndReplicaCounts = ["Security": 2, "Schemas": 1, "Meters": 1, "App-Services": 1]

0 commit comments

Comments
 (0)