Loading TOC...

admin.forestForeignReplica

admin.forestForeignReplica(
   $foreign-cluster-id as (Number|String),
   $foreign-database-id as (Number|String),
   $foreign-forest-id as (Number|String)
) as element(as.foreignReplica)

Summary

This function returns a replica forest configuration. Use the output of this function in the admin:forest-set-foreign-replicas function to place the replica forest configuration into the cluster configuration. This function must be executed on the master host.

Parameters
$foreign-cluster-id The ID of the foreign cluster containing the replica host.
$foreign-database-id The ID of the replica database.
$foreign-forest-id The ID of the foreign forest.

Example

  
  const admin = require('/MarkLogic/admin.xqy');
  var cfg = admin.getConfiguration()
  var fcl = admin.clusterGetForeignClusterId(cfg, "ClusterA")
  var fdb = admin.databaseForeignReplicaGetDatabaseId(
                      admin.databaseGetForeignReplicas(cfg, xdmp.database("Documents")))
  admin.forestForeignReplica(fcl, fdb , 2331251018938912591)

   //Returns a replica forest configuration for the master 'Documents' forest. 
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.