Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -431,16 +431,32 @@ private void initializeHasTlsPorts() {
private void renameNode() {
logger().debug("Renaming Couchbase Node from localhost to {}", getHost());

@Cleanup
Response response = doHttpRequest(
MGMT_PORT,
"/node/controller/rename",
"POST",
new FormBody.Builder().add("hostname", getInternalIpAddress()).build(),
false
);
for(int i=1; i<=6; i++) {
try {
@Cleanup
Response response = doHttpRequest(
MGMT_PORT,
"/node/controller/rename",
"POST",
new FormBody.Builder().add("hostname", getInternalIpAddress()).build(),
false
);
checkSuccessfulResponse(response, "Could not rename couchbase node");
break;
} catch (Exception e) {
if(i==6) {
throw e;
} else {
logger().debug("Error when trying to rename node, will retry. {}" ,e);
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
throw new RuntimeException(ex);
}
}
}
}

checkSuccessfulResponse(response, "Could not rename couchbase node");
}

/**
Expand Down