Loading TOC...

admin:restart-hosts

admin:restart-hosts(
   hosts as xs:unsignedLong*
) as empty-sequence()

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.
:)
xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
declare namespace host="http://marklogic.com/xdmp/status/host";

let $hostids :=
   for $id in xdmp:host-status(xdmp:host())
                               /host:hosts//host:host/host:host-id
   return fn:data($id)
return
admin:restart-hosts($hostids)
  

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