forked from marklogic/ml-app-deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
marklogic#40 Added task for configuring forest replicas
- Loading branch information
Showing
8 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This project shows an example of configuring replica forests for the out-of-the-box databases that are typically worth | ||
enabling failover. | ||
|
||
Note that you'll need to run this against a cluster with at least two nodes (failover requires three nodes, but you | ||
only need two nodes to see how ml-gradle will create replica forests). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven {url "http://developer.marklogic.com/maven2/"} | ||
maven {url "http://rjrudin.github.io/marklogic-java/releases"} | ||
} | ||
dependencies { classpath mlGradleDependency } | ||
} | ||
|
||
apply plugin: 'ml-gradle' | ||
|
||
mlConfigureForestReplicas.command.forestNamesAndReplicaCounts = [ "Security": 2, "Schemas": 1, "Meters": 1, "App-Services": 1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
mlGradleDependency=com.rjrudin:ml-gradle:2.0b8 | ||
|
||
mlHost=localhost | ||
mlAppName=failover-example | ||
mlRestPort=8130 | ||
mlUsername=admin | ||
mlPassword=admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/groovy/com/rjrudin/marklogic/gradle/task/forests/ConfigureForestReplicasTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.rjrudin.marklogic.gradle.task.forests | ||
|
||
import org.gradle.api.tasks.TaskAction | ||
|
||
import com.rjrudin.marklogic.appdeployer.command.forests.ConfigureForestReplicasCommand | ||
import com.rjrudin.marklogic.gradle.task.MarkLogicTask | ||
|
||
/** | ||
* Task for executing an instance of ConfigureForestReplicasCommand. The command is exposed as a task attribute so | ||
* that its map of forest names and replica counts and be configured easily in a Gradle build file. | ||
*/ | ||
class ConfigureForestReplicasTask extends MarkLogicTask { | ||
|
||
ConfigureForestReplicasCommand command = new ConfigureForestReplicasCommand() | ||
|
||
@TaskAction | ||
void configureReplicaForests() { | ||
command.execute(getCommandContext()) | ||
} | ||
} |