admin:forest-foreign-replica( $foreign-cluster-id as xs:unsignedLong, $foreign-database-id as xs:unsignedLong, $foreign-forest-id as xs:unsignedLong ) as element(as:foreign-replica)
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. |
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $cfg := admin:get-configuration() let $fcl := admin:cluster-get-foreign-cluster-id($cfg, "ClusterA") let $fdb := admin:database-foreign-replica-get-database-id( admin:database-get-foreign-replicas($cfg, xdmp:database("Documents"))) return admin:forest-foreign-replica($fcl, $fdb , 2331251018938912591) (: Returns a replica forest configuration for the master 'Documents' forest. :)