Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin.restartHosts

admin.restartHosts(
   hosts as (Number|String)[]
) as null

Summary

This function restarts MarkLogic Server for the specified hosts.

Parameters
hosts The host ID(s) for the host(s) you want to restart. For example, xdmp:host() returns the ID for the current host.

Example

  

//This query restarts all hosts in the cluster.//Note that
//it will restart the host in which the query is run, too.
const admin = require('/MarkLogic/admin.xqy');
const host="http://marklogic.com/xdmp/status/host";
const hostids = xdmp.hostStatus(xdmp.host()).toObject().map(
                function(a){return a.hostId})
admin.restartHosts(hostids)
  

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