Install the admin username and password, and initialize the security database and objects.
Upon success, MarkLogic Server returns status code 202 (Accepted) and the response body contains a timestamp and a link to the timestamp service. Use this information to detect when the server restart completes.
This request must be directed to the MarkLogic Server Admin Interface on port 8001. For
example: http://localhost:8001/admin/v1/instance-admin
.
You must call
POST /admin/v1/init
or otherwise initialize MarkLogic Server prior to using
this method.
Only call this method on a standalone host (not intended to
be part of a cluster), or the initial bootstrap host of a cluster. Do not use this method on
additional hosts in a cluster. Instead, use the cluster join sequence shown in POST
/admin/v1/cluster-config
.
You can supply the admin user name and
password using either XML, JSON or form data. If you choose form data, you must set the
Content-type header to application/x-www-form-urlencoded
If you choose XML or
JSON, you can specify the content type using either the format
request
parameter or the Content-type header. Use the following templates for the POST body;
admin-username
and admin-password
are the only required
settings.
XML:
<instance-admin xmlns="http://marklogic.com/manage">
<admin-password>your-admin-username</admin-password>
<admin-username>your-admin-password</admin-username>
<wallet-password>your-wallet-password</wallet-password>
<realm>public</realm>
</instance-admin>
JSON:
{ "admin-username" : "your-admin-username",
"admin-password" : "your-admin-password",
"wallet-password" : "your-wallet-password",
"realm" : "public"
}
Form Data (must be URL encoded):
admin-username=adminuser&admin-password=mypassword&wallet-password=walletpassword&realm=public
If successful, this method causes MarkLogic Server to restart. You can use
the timestamp and the link to the timestamp service to poll the status of the restart. For
details, see GET /admin/v1/timestamp
.
For details and a complete example, see Setting Up the First Host in a Cluster in the Scripting Administrative Tasks Guide.
$ curl -i -X POST \ --data "admin-username=adminuser&admin-password=mypassword&wallet-password=walletpassword&realm=public" \ http://localhost:8001/admin/v1/instance-admin ==> MarkLogic Server responds with headers and a response body similar to the following: HTTP/1.1 202 Accepted Content-type: application/xml Location: /admin/v1/timestamp ... <restart xmlns="http://marklogic.com/manage"> <last-startup host-id="13544732455686476949"> 2013-04-01T10:35:19.09913-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>