首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用林复制副本创建数据库

使用林复制副本创建数据库
EN

Stack Overflow用户
提问于 2015-12-17 22:47:21
回答 3查看 153关注 0票数 1

我要创建一个带有用于故障切换的复制副本连接的数据库:

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

创建数据库

代码语言:javascript
复制
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 } }' 

创建副本

代码语言:javascript
复制
 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‘。

非常感谢

EN

回答 3

Stack Overflow用户

发布于 2015-12-17 23:25:32

“有从数据库中分离林的命令吗”

我想您可能从这个REST endpoint中得到了您想要的东西

在解释您可以控制的项目方面,该页面相当完整。

也许这个模式是:get -> modify -> put

票数 1
EN

Stack Overflow用户

发布于 2015-12-18 00:42:23

排序:谢谢,大卫。

Had enabled = false然后为true

如下链接所示:

代码语言:javascript
复制
 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

该数据库随后将从林中分离,因此您现在可以删除该林。

代码语言:javascript
复制
curl -X DELETE --anyauth --user us:pw  http://localhost:8002/manage/v2/forests/testdb?level=full
票数 1
EN

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34337390

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档