I am sure hosts are reachable. The coupling works well when I couple them via 
admin UI but it does not seem to work when I couple them with the script I 
mentioned.

-Sudheer

From: [email protected] 
[mailto:[email protected]] On Behalf Of Geert Josten
Sent: Tuesday, February 23, 2016 12:56 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] XDMP-NOCLUSTER : No cluster with 
Identifier error

Hi Sudheer,

Are you sure all hosts in the cluster can reach each other with the host-names 
listed in your MarkLogic instances? You can use IP's for ML host names if 
necessary..

Cheers,
Geert

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Sudheer Yalaverthi 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Monday, February 22, 2016 at 10:48 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: [MarkLogic Dev General] XDMP-NOCLUSTER : No cluster with Identifier 
error

Hi,

I am trying to couple two clusters with the below xquery script.

I am seeing the an error in the logs though the configuration on the admin page 
seem to be same as when configured via admin UI. Bootstrapping is subsequently 
not happening when I couple with the script.
2016-02-22 21:30:57.558 Warning: XDQPHost::heartbeat: XDMP-NOCLUSTER: No 
cluster with identifier 13464593732689255964

I have this cluster 13464593732689255964 existing though from which is where I 
am basically running the script.


xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

declare namespace hosts = "http://marklogic.com/manage/hosts";;
declare namespace clusters = "http://marklogic.com/manage/clusters";;
declare variable $config :=
    <config>
        <ssl-enabled>false</ssl-enabled>
        <local>
            <cluster-name>Primary</cluster-name>
        </local>
        <foreign>
            <cluster-name>DR</cluster-name>
            <bootstrap-host>remotehost44.com</bootstrap-host>
            <user>admin</user>
            <pass>admin</pass>
            <bind-port>7998</bind-port>
            <certificate>-----BEGIN CERTIFICATE-----
MIICzDCCAbSgAwIBAgIJAK3hbUfOk/ZbMA0GCSqGSIb3DQEBCwUAMB4xHDAaBgNV
BAMMEzcxMTQxMDA3OTA0MDM0MzQ5MTAwHhcNMTYwMjEyMTQ0MTQ4WhcNMjYwMjA5
MTQ0MTQ4WjAeMRwwGgYDVQQDDBM3MTE0MTAwNzkwNDAzNDM0OTEwMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqi8BmoVpnnjGmJrhHx7dBPcplTgAsR7k
EpPIrBInadXm7as8ADAhS1MLRvzqlzoa77f5JrYu4BBglkbkjW5hp6adbOnXg4
vj0uLVW8imwvpDWMSZXmu0Xs+oW8sTRLvLT6zXSVeytQusyQzoIe/H3Zpvn96lHB
5ZtR0EJyKMnu4BQX75lszu5P1EqU4kMpm2RcEsWg1xbxj2nQmaqUgBdDUhZHWS6p
tAM9RztkhkMN8MvsuQZo7fCIQ1yzEN2uhaJml3LAzl+WLJh+N4RkOgYZE3RWySNM
1K8N8KG1FNNt7SFTu7LOFhTkS2GN9t01VAIraY1uqlxCltiNGiqghwIDAQABow0w
CzAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAsup/G8VIcZnwn5CFiNqvh
ey/3PhMhXNOme1eq6oBTZuNHsaiwx+kl8ZLgy1yOxGwf8Fxtg0tpJ4wFfj8jbok3
UimF8lcmJdJw9GdASfoxjAuXGlq05UMtPiP46NCzgxhfAPe74hVHv2rEoh5jUF4o
jfJFH01CnRB3Qszqt4IW/rLnf9b3sif1fHGiJIXx8WZFkgR2N6WHZrCoxuSY92av
W28LnpLFllx+LDlAp78ApyAjGQm/empquNqgaAqAgV7+1u1OcHTsv6CEAe8Qn+a4
QmIc5tN5C8Ncyyl1fpV1N88VxzL0xyL5eYFFAJfieJe8QbeJuL8DYuV6cULuSEz3
-----END CERTIFICATE-----</certificate>
        </foreign>
        <ssl-ciphers></ssl-ciphers>
        <xqdt-timeout>10</xqdt-timeout>
        <host-timeout>30</host-timeout>
    </config>;



declare function local:get-host-id($host, $ssl as xs:boolean, $username, 
$password, $options) {
    let $protocol := if ($ssl) then "https" else "http"
    let $url := $protocol || "://" || $host || ":8002/manage/v2/hosts/" || 
$host || "?format=xml"
    return xs:unsignedLong(xdmp:http-get($url, $options)[2]//hosts:id/string())
};
declare function local:get-cluster-id($host, $ssl as xs:boolean, $username, 
$password, $cluster-name, $options) {
    let $protocol := if ($ssl) then "https" else "http"
    let $url := $protocol || "://" || $host || ":8002/manage/v2/clusters/" || 
$cluster-name || "?format=xml"
    return xs:unsignedLong(xdmp:http-get($url, 
$options)[2]//clusters:id/string())
};

let $options := <options xmlns="xdmp:http">
                    <authentication method="digest">
                        <username>{$config/*:foreign/*:user/text()}</username>
                        <password>{$config/*:foreign/*:pass/text()}</password>
                    </authentication>
                </options>

let $local-cluster-name := $config/local/cluster-name/string()
let $foreign-host := $config/foreign/bootstrap-host/string()
let $foreign-bind-port as xs:unsignedInt := 
xs:unsignedInt($config/foreign/bind-port/string())
let $foreign-host-user := $config/foreign/user/string()
let $foreign-host-password := $config/foreign/pass/string()
let $use-ssl := xs:boolean($config/ssl-enabled/string())
let $foreign-cluster-name := $config/foreign/cluster-name/string()
let $foreign-host-id as xs:unsignedLong := local:get-host-id($foreign-host, 
$use-ssl,$config/foreign/user/string(), $config/foreign/pass/string(), $options)
let $foreign-certificate := $config/foreign/certificate/string()
let $foreign-cluster-id  := local:get-cluster-id($foreign-host,$use-ssl, 
$foreign-host-user,$foreign-host-password, $foreign-cluster-name, $options)
let $foreign-host-record := 
admin:foreign-host($foreign-host-id,$foreign-host,$foreign-bind-port)
let $_ := 
admin:save-configuration(admin:cluster-set-name(admin:get-configuration(),$local-cluster-name))

return
    if(fn:not($foreign-cluster-id eq 
admin:cluster-get-foreign-cluster-ids(admin:get-configuration()))) then
    (
        admin:save-configuration(
            admin:foreign-cluster-create(admin:get-configuration(), 
$foreign-cluster-id, $foreign-cluster-name, 10, 30, $foreign-certificate, 
fn:false(), fn:true(), fn:true(), "ALL", $foreign-host-record)),
            xdmp:log("Coupled to "||$foreign-host||" as cluster 
"||$foreign-cluster-name||" on port "||$foreign-bind-port)
    )
    else xdmp:log($foreign-host||" already connected to 
"||xdmp:host-name(xdmp:host()))



Any thoughts??



Regards,
Sudheer Yalaverthi
NoSQL Engineer



---
This communication may contain confidential and/or privileged information. If 
you are not the intended recipient (or have received this communication in 
error) please notify the sender immediately and destroy this communication. Any 
unauthorized copying, disclosure or distribution of the material in this 
communication is strictly forbidden.

Deutsche Bank does not render legal or tax advice, and the information 
contained in this communication should not be regarded as such.


---
This communication may contain confidential and/or privileged information. If 
you are not the intended recipient (or have received this communication in 
error) please notify the sender immediately and destroy this communication. Any 
unauthorized copying, disclosure or distribution of the material in this 
communication is strictly forbidden.

Deutsche Bank does not render legal or tax advice, and the information 
contained in this communication should not be regarded as such.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to