我正在尝试使用 ml-gradle 更改计划的 MarkLogic 数据库备份设置。我可以使用gradle mlDeploy部署数据库。但是,当更改它的计划备份属性时,我在再次运行 mlDeploy 时收到“数据库配置不同”错误。
数据库的当前 json 文件如下所示:
"database-name" : "caspar-test",
"range-element-index" : [ {
"scalar-type" : "string",
"namespace-uri" : "CHANGEME",
"localname" : "CHANGEME",
"collation" : "http://marklogic.com/collation/",
"range-value-positions" : false,
"invalid-values" : "reject"
} ],
"database-backup": [ {
"backup-id": "1373474833703299773",
"backup-enabled": true,
"backup-directory": "/backup/caspar-test",
"backup-type": "daily",
"backup-period": 1,
"backup-start-time": "13:01:00Z",
"backup-timestamp": "2019-09-06T13:55:25.243878Z",
"max-backups": 2,
"backup-security-database": true,
"backup-schemas-database": true,
"backup-triggers-database": true,
"include-replicas": true,
"incremental-backup": false,
"journal-archiving": false,
"journal-archive-path": "",
"journal-archive-lag-limit": 15
} ]
}
对于测试,我将“启用备份”设置为 false。运行 ml-gradle 显示
Logging HTTP response body to assist with debugging: {"errorResponse":{"statusCode":"500", "status":"Internal Server Error", "messageCode":"CMA-ERRORCONFIG", "message":"CMA-ERRORCONFIG (err:FOER0000): MANAGE-CONFLICTINGCONFIGerr:FOER00001.0-mlA conflict has been detected: MANAGE-CONFLICTINGCONFIG: (err:FOER0000) A conflict has been detected: database configurations differ: database-backupsfalse database configurations differ: database-backups/MarkLogic/manage/models/database-idempotent.xqy7186xdmp:function(fn:QName(\"http://marklogic.com/manage/database/idempotent\",\"check-database-property-idempotent-database-backups\"))(<configuration/>, xs:unsignedLong(\"11315473330229343670\"), <database-backups xmlns=\"http://marklogic.com/manage/database/properties\">...</database-backups>)config<configuration/>dbidxs:unsignedLong(\"11315473330229343670\")prop<database-backups xmlns=\"http://marklogic.com/manage/database/properties\">...</database-backups>alist<database-backup xmlns=\"http://marklogic.com/xdmp/database\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">...</database-backup>plist<database-backup xmlns=\"http://marklogic.com/manage/database/properties\">...</database-backup>compare<database-backup xmlns=\"http://marklogic.com/xdmp/database\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">...</database-backup>1.0-ml/MarkLogic/manage/models/database-idempotent.xqy9011dmodi:check-database-property-update-idempotent(<configuration/>, xs:unsignedLong(\"11315473330229343670\"), <database-backups…
据我了解,计划的数据库备份设置可以通过 API 更改,因为它们正在通过 PUT 进行更新。因此,我希望 ml-gradle 能够毫无问题地处理此任务。我在这里错过了什么吗?
更新
如果您需要进一步挖掘类似问题:使用“-i”调用“ml-gradle”,因为它会转储它尝试应用的 json。您可以将此 json 保存到文件中,并使用类似的命令自行应用
curl -X POST --anyauth --user user:password -H 'Content-type: application/json' --header "Accept: application/json" -d@file.json http://host.name:8002/manage/v3
请注意,MarkLogic 提供了具有 PUT 和 POST 的 v2 API 以及仅接受 POST 进行更改的 v3。当前的问题来自使用 /manage/v3