1

我需要 Zookeeper 的 REST API,我指的是https://github.com/Netflix/exhibitor/wiki/REST-Configuration但我只是无法执行 POST API。

我在哪里可以获得使用参展商的示例 curl 请求。或者有人可以发布一个示例来设置配置。curl 查询如下,它需要 config 作为参数。

curl -i -X POST "http://hostname:8080/exhibitor/v1/config/set

那么最终的 curl 请求将如何以任何配置作为参数。所以基本上我只是无法添加论点。

4

1 回答 1

1

我想到了。:)

curl -i -X POST “http://hostname:8080/exhibitor/v1/config/set” -d '{"rollInProgress":false,"rollStatus":"n/a","rollPercentDone":0,"hostname":"hostname.com","serverId":-1,"logIndexDirectory":"","zookeeperInstallDirectory":"","zookeeperDataDirectory":"","zookeeperLogDirectory":"","serversSpec":"","backupExtra":"","zooCfgExtra":{},"javaEnvironment":"","log4jProperties":"","clientPort":0,"connectPort":0,"electionPort":0,"checkMs":0,"cleanupPeriodMs":0,"cleanupMaxFiles":10,"backupMaxStoreMs":0,"backupPeriodMs":0,"autoManageInstances":0,"autoManageInstancesSettlingPeriodMs":0,"observerThreshold":0,"controlPanel":{}}'

您必须提供整个配置。并更改您希望更改的属性的值。

于 2013-02-11T12:09:07.147 回答