我要创建一个带有用于故障切换的复制副本连接的数据库:
目前,我只能创建数据库,然后分离并删除林,然后在下一个命令中创建林副本。
创建数据库
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‘。
非常感谢
发布于 2015-12-17 23:25:32
发布于 2015-12-18 00:42:23
排序:谢谢,大卫。
Had enabled = 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发布于 2015-12-23 18:55:50
这样效果更好
curl --anyauth --用户用户:password -X POST -i \ -d "state=attach“-d "database=Documents”\ -H“内容类型:应用程序/x-www-form-urlencoded”\ http://localhost:8002/manage/v2/forests/example
https://stackoverflow.com/questions/34337390
复制相似问题