Remove a host's configuration from the cluster configuration, dropping the host
from the cluster. The remote-host
parameter is required if you are removing a
host from a different group.
If you request a host to remove itself, MarkLogic Server returns status code 202 (Accepted) and the data in the response body includes the timestamp of the last restart and a link to the timestamp endpoint.
If you request one host to remove another (by
using the remote-host
request parameter), MarkLogic Server returns status code
204 (No Content).
If the pre-requistes described in the Usage Notes are not met, MarkLogic Server returns status code 400 with a detailed error message specifying which pre-requisites are not met.
manage-admin
role, or the following
privilege: http://marklogic.com/xdmp/privileges/manage-admin
This request must be directed to the MarkLogic Server Admin Interface on port 8001. For
example: http://localhost:8001/admin/v1/host-config
.
The host being removed from the cluster must meet the following criteria for the removal request to be accepted:
If and only if the above criteria are met, the host is removed from the cluster. You
can remove a host either by requesting it to remove itself or by requesting another host to
remove it, using remote-host
.
The preferred method is to request a host to remove itself by sending a DELETE request directly to it. This results in a clean, but uninitialized standalone MarkLogic host and a functioning cluster.
If you request
one host in the cluster to remove another (by specifying the host to be removed using
remote-host
), the result is a function cluster, but the removed host is no
longer a viable MarkLogic Server instance. If the removed host is still live, it will
continue to try to communicate with the cluster until it is shut down. This method is best
used to drop a dead host from a cluster or when the departing host will be shut down
immediately.
$ curl --anyauth --user user:password -X DELETE -i \ http://departing-host:8001/admin/v1/host-config ==> Request a host to leave the cluster, resulting in a restart. This is the preferred way to remove a host from a cluster. MarkLogic Server sends a response similar to the following. Use the Location header or the restart/link/uriref to detect when the restart is complete. HTTP/1.1 202 Accepted Content-type: application/xml Location: /admin/v1/timestamp Server: MarkLogic Content-Length: 260 Connection: Keep-Alive Keep-Alive: timeout=5 <restart xmlns="http://marklogic.com/manage"> <last-startup host-id="13544732455686476949"> 2013-05-15T09:01:43.019261-07:00 </last-startup> <link> <kindref>timestamp</kindref> <uriref>/admin/v1/timestamp</uriref> </link> <message>Check for new timestamp to verify host restart.</message> </restart>
$ curl --anyauth --user user:password -X DELETE -i \ http://cluster-host:8001/admin/v1/host-config?remote-host=departing-host ==> Request one host to remove another from a cluster. The departing host is not restarted and is not a viable instance. MarkLogic Server responds with status code 204 (No Content). HTTP/1.1 204 No Content Server: MarkLogic Content-Length: 0 Connection: Keep-Alive Keep-Alive: timeout=5
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.