cma.applyConfig( config as (binary()|node())[], [config-options as Object?], [params as Object?], [format as String?] ) as (emptySeq|node())
Apply a named configuration, overriding parameters and setting options.
This function applies a named configuration, overriding parameters and setting options.
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:
replicaSameZoneAsMaster
true
or
false
. The default value is true
.masterDatabase
"myHADatabase"
.triggersDatabase
"myHATriggers"
.schemasDatabase
"myHASchemas"
.securityDatabase
"Security"
.addReplicaToExistingForests
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
.numberOfMasterForests
numberOfReplicasPerForest
numberOfForestsPerHost
masterDataDirectory
"/tmp"
(e.g. returned by xdmp:data-directory())
function
call).masterFastDataDirectory
"/tmp"
.masterLargeDataDirectory
"/tmp"
.masterReplicaDataDirectory
"/tmp"
.masterReplicaFastDataDirectory
"/tmp"
.masterReplicaLargeDataDirectory
"/tmp"
.
// Apply configuration ZIP. 'use strict'; const cma = require('/MarkLogic/cma.sjs'); cma.applyConfig($zip);
// Create a REST server. 'use strict'; const cma = require('/MarkLogic/cma.sjs'); const json = { "config": [{ "forest":[{"forest-name":"mydb1-f1"},{"forest-name":"mymodulesdb-f1"}], "database": [{ "database-name": "myDb", "forest":["mydb1-f1"] }, { "database-name": "myModulesDb", "forest":["mymodulesdb-f1"] } ], "server": [{ "server-name": "restapiServer", "server-type": "http", "group-name":"Default", "root": "/", "port": "8900", "url-rewriter": "/MarkLogic/rest-api/8000-rewriter.xml", "content-database": "myDb", "modules-database": "myModulesDb" }] }] }; cma.applyConfig(json);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.