Marklogic 使用林副本创建数据库

Marklogic 使用林副本创建数据库,marklogic,Marklogic,我想创建一个连接了副本的数据库以进行故障切换: 我目前只能创建数据库,然后分离并删除林,然后在下一个命令中创建林副本 创建数据库 curl -v -X POST --anyauth -u us:pw http://localhost:8002/v1/rest-apis \ --header "Content-Type:application/json" \ -d '{"rest-api": { "name": "testdb", "database": "testdb", "modules d

我想创建一个连接了副本的数据库以进行故障切换:

我目前只能创建数据库,然后分离并删除林,然后在下一个命令中创建林副本

创建数据库

curl -v -X POST  --anyauth -u us:pw http://localhost:8002/v1/rest-apis \
--header "Content-Type:application/json" \
-d '{"rest-api": { "name": "testdb", "database": "testdb", "modules
database": "testdb-modules", "forests-per-host": 2 } }' 
创建副本

 curl -s --anyauth --user us:pw -X POST -i -H 'Content-type:      application/json' http://localhost:8002/manage/v2/forests -d '
{ 
"forest-name": "testdb-8", 
"host": "ip-10-10-30-243.eu-west-1.compute.internal",  
"database": "testdb", 
"forest-replicas": { 
 "forest-replica":[ 
    { "replica-name": "testdb-8-Rep01", "host": "ip-10-10-31-238.eu-west-1.compute.internal" },  
    { "replica-name": "testdb-8-Rep02", "host": "ip-10-10-32-253.eu-west-1.compute.internal" }  
]
} 
 } '
还有一个“curl”将林与数据库分离

非常感谢

“是否有将林与数据库分离的命令”

我想你可能会从这次休息中得到你想要的:

该页面对您可以控制的项目进行了完整的解释

也许这个模式:->modify->

排序:谢谢David

必须启用=false然后为true

如以下链接所示:

 curl --anyauth --user us:pw -X PUT -d @./forest-properties.xml \
-i -H "Content-type: application/xml" \
http://localhost:8002/manage/v2/forests/testdb/properties
然后,该数据库将从林中分离,因此您现在可以删除该林

curl -X DELETE --anyauth --user us:pw  http://localhost:8002/manage/v2/forests/testdb?level=full
这个效果更好

curl--anyauth--user-user:password-X POST-i\ -d“状态=附加”-d“数据库=文档”\ -H“内容类型:应用程序/x-www-form-urlencoded”\

谢谢,在前面的讨论中,可以创建和添加副本和关联,但不能从数据库中分离,在此情况下的林需要正数-否则命令失败。听起来您已经解决了问题-请将答案标记为“已接受”这样,看这个问题的人知道你不需要额外的帮助。