cma:generate-config( [$config as (binary()|node())?], [$config-options as map:map?], [$default-params as map:map?], [$format as xs:string?], [$scenario as xs:string?] ) as (binary()|node())
Retrieve an individual resource, set of resources, or full cluster configuration; generate a configuration from scenarios.
This function retrieves selected resource(s) configuration or generates a configuration from scenarios. Configuration options define how the configuration is generated.
The default namespace for configuration packages is
http://marklogic.com/manage/config
.
<configuration xmlns="http://marklogic.com/manage/config">
The available core scenarios are summarized below. The details on each scenario follow.
Local disk failover provides High Availability (HA) by replicating forest data to other hosts. When any particular host goes down, forests' replicas will mount on the other hosts.
The parameters for HA Local Failover scenario are:
replica-same-zone-as-master
true
or
false
. The default value is true
.master-database
"myHADatabase"
.triggers-database
"myHATriggers"
.schemas-database
"myHASchemas"
.security-database
true
.add-replica-to-existing-forests
false
- no attempt is made to add replicas; when set to
true
- replicas will be added to the forest, with total summing up to
number-of-replicas-per-forest
. The allowed values are true
or false
. The default value is false
.create-security-database-replicas
true
, will create replicas for security database. Note that
this is particularly dangerous when uninstalling a package. The default value is
false
.number-of-master-forests
number-of-ancillary-forests
number-of-replicas-per-master-forest
number-of-replicas-per-ancillary-forest
number-of-master-forests-per-host
number-of-forests-per-host
, arbitrarily setting
absolute number of master forests per host. The value is positive integer.number-of-forests-per-host
master-data-directory
"/tmp"
(e.g. returned by xdmp:data-directory())
function
call).master-fast-data-directory
"/tmp"
.master-large-data-directory
"/tmp"
.master-replica-data-directory
"/tmp"
.master-replica-fast-data-directory
"/tmp"
.master-replica-large-data-directory
"/tmp"
.
(: Generate configuration of the entire cluster. :) xquery version "1.0-ml"; import module namespace cma="http://marklogic.com/manage/config" at "/MarkLogic/cma.xqy"; cma:generate-config()
(: Generate configuration of the entire cluster without properties - just resource names and identifiers. :) xquery version "1.0-ml"; import module namespace cma="http://marklogic.com/manage/config" at "/MarkLogic/cma.xqy"; cma:generate-config((),map:new()=>map:with("include-properties",false()),(),"xml",())
(: Generate forests configuration. :) xquery version "1.0-ml"; import module namespace cma="http://marklogic.com/manage/config" at "/MarkLogic/cma.xqy"; cma:generate-config((),map:new()=>map:with("resource-type","forest"),(),"xml",())
(: Generate configuration XML of ha-local scenario. :) xquery version "1.0-ml"; import module namespace cma="http://marklogic.com/manage/config" at "/MarkLogic/cma.xqy"; cma:generate-config((),(),(),"xml","ha-local")
(: Generate configuration ZIP of ha-local scenario. :) xquery version "1.0-ml"; import module namespace cma="http://marklogic.com/manage/config" at "/MarkLogic/cma.xqy"; cma:generate-config((),(),(),"zip","ha-local")
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.