Search code examples
marklogicmarklogic-10

How to replace my boot start host/node in Marklogic


I want to replace my boot start node/host with different host name in Marklogic cluster, is it possible?


Solution

  • If you are looking to change the name of the host, do know that the hostname still needs to be resolvable by the other nodes in the cluster.

    You will need to have both old and new resolvable by DNS or create temporary /etc/hosts entries to ensure that all of the hosts can resolve the IP as you make the change from the old to the new name.

    You can update the host name in the Admin UI:

    https://help.marklogic.com/Knowledgebase/Article/View/renaming-hosts-in-ml-cluster

    Using MarkLogic Server's Admin UI, it is possible to modify the name of a single host via Admin UI -> Configure -> Hosts -> 'Select Host in question' and update the name and click ok.

    or you can do it programmatically using admin:host-set-name() and then save the configurations with admin:save-configuration()

    xquery version "1.0-ml";
    import module namespace admin = "http://marklogic.com/xdmp/admin"
          at "/MarkLogic/admin.xqy";
    let $config := admin:get-configuration()
    let $hostid := admin:host-get-id($config, "myOldHostname")
    return
      admin:save-configuration(admin:host-set-name($config, $hostid, "myNewHostName"))