
admin.restartHosts( hosts as (Number|String)[] ) as null
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.
	     | 
	  
  
//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)