Loading TOC...

GET /admin/v1/server-config


Retrieve MarkLogic Server configuration information, suitable for use in joining a cluster.

Response Headers
Content-type The MIME type of the data in the response body. The response MIME type is always application/xml.


Upon success, MarkLogic Server returns status code 200 (OK) and the response body contains the requested information, expressed as XML.

If license key installation and basic initialization have not yet been done, the response payload will include a timestamp, but all other elements will be empty.

Required Privileges

If security has not yet been installed, no authentication is required. If security has been installed, digest authentication is required, but no privilege checking is done.

Usage Notes

This request must be directed to the MarkLogic Server Admin Interface on port 8001. For example: http://localhost:8001/admin/v1/server-config.

This method is intended for use in the context of other REST Management API methods during cluster configuration, such as using the data returned by this request as input to a POST request to /admin/v1/cluster-config. For the expected sequence, see the examples below.

For details and a complete example, see Scripting Cluster Management in the Scripting Administrative Tasks Guide.


$ curl --anyauth --user user:password -X GET -H "Accept: application/xml" \

==> The configuration of the server my-host.marklogic.com. MarkLogic
    Server responds with output similar to the following. (The security
    certificate has been elided for brevity.) See the additional example
    for the full join sequence.

HTTP/1.1 200 OK
Content-type: application/xml
Server: MarkLogic
Content-Length: 1487
Connection: Keep-Alive
Keep-Alive: timeout=5

<host xmlns="http://marklogic.com/manage">
  <edition>Essential Enterprise</edition>


Use in the following sequence to add a host to a cluster, assuming
clusterhost is a previously fully initialized bootstrap host for
the cluster and joining-host is the host to be initialized and added to
the cluster:

(1) Initialize the new host. For details, see POST /admin/v1/init.
    Use GET /admin/v1/timestamp to verify a successful restart.
    For details, see POST /admin/v1/init.

    $ curl -X POST -d "" http://joining-host:8001/admin/v1/init
    $ curl -X GET http://joining-host:8001/admin/v1/timestamp

(2) Retrieve the configuration of the joining host, to be used as the
    value of the server-config param to POST /admin/v1/cluster-config.

    $ curl -o joiner-config.xml -X GET -H "Accept: application/xml" \

    ==> The configuration for joining-host is saved to joiner-config.xml.
        See the previous example for the output details.

(3) Send the joining host's URL encoded config info to the cluster host.
    Receive the cluster configuration in return. For details, see
    POST /admin/v1/cluster-config.

    $ curl --anyauth --user user:password -X POST -d "group=Default" \
        --data-urlencode "server-config@./joiner-config.xml" \
        -H "Content-type: application/x-www-form-urlencoded" \
        -o cluster-config.zip http://clusterhost:8001/admin/v1/cluster-config

    ==> The cluster configuration data is saved in cluster-config.zip.

(4) Send the cluster configuration ZIP file to the joining host to 
    complete the cluster join sequence. Bracket the POST with calls 
    to GET /admin/v1/timestamp to confirm a successful restart. For
    details, see POST /admin/v1/cluster-config.

    $ curl -X GET http://joining-host:8001/admin/v1/timestamp
    $ curl -X POST -H "Content-type: application/zip" \
        --data-binary @./cluster-config.zip \
    $ curl --anyauth --user user:password -X GET \

    ==> The joining host becomes a functional member of the cluster.

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