Created
February 26, 2019 22:06
-
-
Save derms/823bef4479292cce4d1dd4d1cd9a9196 to your computer and use it in GitHub Desktop.
MarkLogic Init All Hosts on a Cluster
This file contains hidden or 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
task initHosts(type: com.marklogic.gradle.task.MarkLogicTask) { | |
doLast{ | |
def hostManager = new com.marklogic.mgmt.resource.hosts.HostManager(manageClient) | |
def key = findProperty("mlLicenseKey") | |
def licensee = findProperty("mlLicensee") | |
hostManager.hostNames.each{ hostname -> | |
println "Init ${hostname} with licenseKey=${key} and licensee=${licensee}" | |
def adminConfig = adminManager.adminConfig | |
adminConfig.host = hostname | |
adminManager.adminConfig = adminConfig | |
adminManager.init(key, licensee) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment