在使用ml-gradle进行部署期间,我必须使用marklogic API在群集中创建多个引导主机。
我知道我可以通过管理控制台(8001端口)对其进行配置,但是我无法弄清楚如何使用MarkLogic API在MarkLogic群集中添加多个引导主机?
我会假设您是指Management API。如果是这种情况,那么您可以针对主机端点POST以定义引导主机]
https://docs.marklogic.com/REST/POST/manage/v2/hosts
cat myHost.json
==>
{
"host-name": "hostname1",
"group": "",
"bind-port": 8090,
"foreign-bind-port": 9091,
"zone": "",
"bootstrap-host": true
}
curl -X POST --digest -u admin:admin -H "Content-type: application/json" \
-d @myHost.json http://localhost:8002/manage/v2/hosts
==> Defines the host, named "hostname1," as the bootstrap host in
the cluster.
以下案例在邮递员]中工作:
HTTP Verb:
PUT
Authorization:
Digest Auth admin:admin
Header:
Content-Type application/json
URI:
{ml-host}:8002/manage/v2/hosts/{new-bootstrap-host}/properties
Body:
{
"bootstrap-host": true
}
Bootstrap主机-> dh5a