You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2014/10/09 08:57:18 UTC
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
GitHub user ahgittin opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/234
Couchbase rebalance timeout fix and a few other comments
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ahgittin/incubator-brooklyn couchbase-xdcr
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/234.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #234
----
commit 0b00658028760b5b272084eaad0d75ede9a2cf84
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date: 2014-10-08T21:09:10Z
correct rebalanceStatus endpoint and improve reporting
commit b89c2069a7fd351214fc87638c4dc87a2827f736
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date: 2014-10-08T21:28:02Z
use REST API to add a server node, and other misc cleanups
commit 489e820be7f17ac84f7f72f26cf51d66256be364
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date: 2014-10-08T21:34:31Z
putative WebTasks API
commit c43aa95b99d8284d675249fc492b9f2212c95589
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date: 2014-10-09T06:51:41Z
couchbase tidy REST API usage and CLI usage - WIP
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/234#issuecomment-58509866
Changes look sensible. Will see if I can find time to test this as well, before merging.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-brooklyn/pull/234
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/234#discussion_r18644861
--- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeSshDriver.java ---
@@ -392,33 +415,76 @@ public Boolean call() throws Exception {
).apply(nodesResponse);
}
- private boolean isNodeRebalancing(String nodeHostAndPort) throws URISyntaxException {
- HttpToolResponse response = getAPIResponse("http://" + nodeHostAndPort + "/pools/nodes/rebalanceProgress");
+ private boolean isNodeRebalancing(String nodeHostAndPort) {
+ HttpToolResponse response = getApiResponse("http://" + nodeHostAndPort + "/pools/default/rebalanceProgress");
if (response.getResponseCode() != 200) {
- throw new IllegalStateException("failed to rebalance cluster: " + response);
+ throw new IllegalStateException("failed retrieving rebalance status: " + response);
}
return !"none".equals(HttpValueFunctions.jsonContents("status", String.class).apply(response));
}
- private HttpToolResponse getAPIResponse(String uri) throws URISyntaxException {
- URI apiUri = new URI(uri);
- Credentials credentials = new UsernamePasswordCredentials(getUsername(), getPassword());
+ private HttpToolResponse getApiResponse(String uri) {
return HttpTool.httpGet(HttpTool.httpClientBuilder()
// the uri is required by the HttpClientBuilder in order to set the AuthScope of the credentials
- .uri(apiUri)
- .credentials(credentials)
+ .uri(uri)
+ .credentials(new UsernamePasswordCredentials(getUsername(), getPassword()))
.build(),
- apiUri,
+ URI.create(uri),
ImmutableMap.<String, String>of());
}
@Override
public void serverAdd(String serverToAdd, String username, String password) {
+ // TODO the POST is failing with SocketException: Connection reset
+ // removing any data makes the problem go away; i suspect it is the combo of:
+ // credentials, an explicit port, and content.
+ // but i do not know how to fix it...
+//// curl -u Administrator:password\
+//// 192.168.60.101:8091/controller/addNode \
+//// -d "hostname=192.168.60.103&user=Administrator&password=password"
+// String baseUrl = Preconditions.checkNotNull(getEntity().getAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_URL), "web admin URL not available");
+// String uri = Urls.mergePaths(baseUrl, "controller/addNode");
+// URI uriU = URI.create(uri);
+//
+// HttpClient client = HttpTool.httpClientBuilder()
+// // the uri is required by the HttpClientBuilder in order to set the AuthScope of the credentials
+// .uri(uriU.getScheme()+"://"+uriU.getHost())
+// .credentials(new UsernamePasswordCredentials(getUsername(), getPassword()))
+// .build();
+// client.getParams().setParameter("http.socket.timeout", new Integer(0));
+// client.getParams().setParameter("http.connection.stalecheck", new Boolean(true));
+//
+// HttpToolResponse response = HttpTool.httpPost(client,
+// URI.create(uri),
+//// ImmutableMap.of(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.getMimeType()),
+// // TODO do we need the above?
+// ImmutableMap.<String,String>of(),
+//
+// ("hostname="+Urls.encode(serverToAdd)+
+// "&user"+Urls.encode(username)+
+// "&password"+Urls.encode(password)).getBytes()
+// // the following two work
+//// "".getBytes()
+//// ImmutableMap.<String,String>of()
+// );
+// if (response.getResponseCode()==200) {
+// log.debug("Completed addNode call for "+serverToAdd+" via REST to "+getEntity()+": "+response.getContentAsString());
+// } else {
+// log.warn("Failed addNode call for "+serverToAdd+" via REST to "+getEntity()+": "+response.getResponseCode()+" / "+response.getContentAsString());
+// throw new IllegalStateException("Failed addNode call for "+serverToAdd+" via REST to "+getEntity()+": "+response.getResponseCode()+" / "+response.getContentAsString());
+// }
+
+ // TODO would like a WebTasks API such as this:
+// DynamicTasks.queue(WebTasks.get(baseUrl).subpath("controller/addNode").credentials(getUsername(), getPassword())
--- End diff --
If/when this is added, can we reuse names etc already used in `HttpFeed` and `HttpPollConfig`. Or refactor that code to have methods that match whatever improvements are desired.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/234#issuecomment-59193224
@ahgittin I presume you've run the integration tests, and run it against a live cloud?
Therefor merging now.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/234#discussion_r18644514
--- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeSshDriver.java ---
@@ -149,13 +153,21 @@ public void install() {
public void customize() {
//TODO: add linux tweaks for couchbase
//http://blog.couchbase.com/often-overlooked-linux-os-tweaks
+ //http://blog.couchbase.com/kirk
--- End diff --
what is this link for? Is there not a permalink to the particular blog, rather than to all of Kirk's blog posts?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Couchbase rebalance timeout fix a...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/234#discussion_r18644497
--- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeSshDriver.java ---
@@ -149,13 +153,21 @@ public void install() {
public void customize() {
//TODO: add linux tweaks for couchbase
//http://blog.couchbase.com/often-overlooked-linux-os-tweaks
+ //http://blog.couchbase.com/kirk
//turn off swappiness
+ //vm.swappiness=0
//sudo echo 0 > /proc/sys/vm/swappiness
+ //os page cache = 20%
+
//disable THP
//sudo echo never > /sys/kernel/mm/transparent_hugepage/enabled
//sudo echo never > /sys/kernel/mm/transparent_hugepage/defrag
+
+ //turn off transparent huge pages
--- End diff --
Do these need `TODO` at the start of the comment? Or are they documenting what subsequent code is actually doing?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---