Github user andreaturli commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/317#discussion_r20218319
  
    --- Diff: 
software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseNodeSshDriver.java
 ---
    @@ -319,68 +317,76 @@ private String getPassword() {
         }
     
         private String getWebPort() {
    -        return 
""+entity.getAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_PORT);
    +        return "" + 
entity.getAttribute(CouchbaseNode.COUCHBASE_WEB_ADMIN_PORT);
         }
     
         private String getCouchbaseHostnameAndCredentials() {
    -        return format("-c localhost:%s -u %s -p %s", getWebPort(), 
getUsername(), getPassword());
    +        return format("-c %s:%s -u %s -p %s", getSubnetHostname(), 
getWebPort(), getUsername(), getPassword());
         }
     
         private String getCouchbaseHostnameAndPort() {
    -        return format("-c localhost:%s", getWebPort());
    +        return format("-c %s:%s", getSubnetHostname(), getWebPort());
         }
     
         private String getClusterInitRamSize() {
             return 
entity.getConfig(CouchbaseNode.COUCHBASE_CLUSTER_INIT_RAM_SIZE).toString();
         }
    -        
    +
         @Override
         public void rebalance() {
             entity.setAttribute(CouchbaseNode.REBALANCE_STATUS, "explicitly 
started");
             newScript("rebalance")
                     .body.append(
    -                couchbaseCli("rebalance") +
    -                        getCouchbaseHostnameAndCredentials())
    +                couchbaseCli("rebalance") + 
getCouchbaseHostnameAndCredentials())
                     .failOnNonZeroResultCode()
                     .execute();
    -        
    +
             // wait until the re-balance is started
             // (if it's quick, this might miss it, but it will only block for 
30s if so)
             Repeater.create()
    -            .backoff(Duration.millis(10), 2, Duration.millis(500))
    -            .limitTimeTo(Duration.THIRTY_SECONDS)
    -            .until(new Callable<Boolean>() {
    -                @Override
    -                public Boolean call() throws Exception {
    -                    for (String nodeHostAndPort : 
CouchbaseNodeSshDriver.this.getNodesHostAndPort()) {
    -                        if (isNodeRebalancing(nodeHostAndPort)) {
    -                            return true;
    -                        }
    -                    }
    -                    return false;
    -                }
    -            })
    -            .run();
    -        
    +                .backoff(Duration.millis(10), 2, Duration.millis(500))
    +                .limitTimeTo(Duration.THIRTY_SECONDS)
    +                .until(new Callable<Boolean>() {
    +                           @Override
    +                           public Boolean call() throws Exception {
    +                               for (HostAndPort nodeHostAndPort : 
getNodesHostAndPort()) {
    +                                   if 
(isNodeRebalancing(nodeHostAndPort.toString())) {
    +                                       return true;
    +                                   }
    +                               }
    +                               return false;
    +                           }
    +                       }
    +                ).run();
    +
             entity.setAttribute(CouchbaseNode.REBALANCE_STATUS, "waiting for 
completion");
    -        // NB: a sensor feed will also update this
    -        
    -        // then wait until the re-balance is complete
    -        boolean completed = Repeater.create()
    -            .backoff(Duration.ONE_SECOND, 1.2, Duration.TEN_SECONDS)
    -            .limitTimeTo(Duration.FIVE_MINUTES)
    -            .until(new Callable<Boolean>() {
    -                @Override
    -                public Boolean call() throws Exception {
    -                    for (String nodeHostAndPort : getNodesHostAndPort()) {
    -                        if (isNodeRebalancing(nodeHostAndPort)) {
    -                            return false;
    +        // Wait until the Docker host is SSHable after the reboot
    --- End diff --
    
    ops, fixing 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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to