3

Does anyone have any examples regarding using mlGradle to configure replica forests? I have looked at the example I could find from the mlGradle project.

https://github.com/rjrudin/ml-gradle/tree/master/examples/sample-project/src/main/ml-config/forests https://github.com/rjrudin/ml-gradle/tree/master/examples/failover-project

And the ML management docs.

https://github.com/rjrudin/ml-gradle/tree/master/examples/failover-project

But I am not clear on how I might be able to configure it for my own forests. I tried the using the mlDeployForestReplicas but did not see any replica creation.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
TJ Tang
  • 921
  • 6
  • 17

1 Answers1

1

mlDeployForestReplicas provides a simple approach for adding replicas. Support for custom forests + replicas is in version 2.3.0 of ml-gradle - it's provided via this ticket - https://github.com/rjrudin/ml-gradle/issues/111 .

You can peek at how it looks in ml-app-deployer - https://github.com/rjrudin/ml-app-deployer/tree/dev/src/test/resources/sample-app/custom-forests/forests/sample-app-content .

There's a 2.3.0-RC1 version of ml-gradle that has this support in it. I'll finish up 2.3.0 and including an example project in ml-gradle.

rjrudin
  • 2,108
  • 9
  • 7
  • Version 2.3.0 of ml-gradle is now available, try that out for custom forests. And see https://github.com/rjrudin/ml-gradle/tree/master/examples/custom-forests-and-replicas-project for an example. – rjrudin Aug 02 '16 at 02:31
  • Thanks @rjrudin. How does the out of the box forest numbering work at the present time? I am going to have a cluster where this is going to be deployed. Right now I just use the default, which creates three forests on each node. If I want to change that slightly where I also create 2 replica forests for each of the forests on the other 2 nodes, is there any way to do that without having to know the node names? – TJ Tang Aug 02 '16 at 12:02
  • Here's the method that generates the forests - https://github.com/rjrudin/ml-app-deployer/blob/master/src/main/java/com/marklogic/appdeployer/command/forests/ConfigureForestReplicasCommand.java#L190 . It determines the primary host of the forest, and then it creates replicas on each of the "next" hosts, up to the value of replicaCount (which is normally 1, but would be 2 in your case). The forest name is "(forest name)-replica-(count)". – rjrudin Aug 03 '16 at 12:49