Skip to content

Commit

Permalink
logging the duplication broker that is running
Browse files Browse the repository at this point in the history
  • Loading branch information
adyliu committed Nov 29, 2013
1 parent 79d70e6 commit 19af388
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/com/sohu/jafka/server/ServerRegister.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ public void registerBrokerInZk() {
try {
ZkUtils.createEphemeralPathExpectConflict(zkClient, brokerIdPath, broker.getZKString());
} catch (ZkNodeExistsException e) {
throw new RuntimeException(
"A broker is already registered on the path " + brokerIdPath + ". This probably " + "indicates that you either have configured a brokerid that is already in use, or " + "else you have shutdown this broker and restarted it faster than the zookeeper " + "timeout so it appears to be re-registering.");
String oldServerInfo = ZkUtils.readDataMaybeNull(zkClient, brokerIdPath);
String message = "A broker (%s) is already registered on the path %s." //
+ " This probably indicates that you either have configured a brokerid that is already in use, or "//
+ "else you have shutdown this broker and restarted it faster than the zookeeper " ///
+ "timeout so it appears to be re-registering.";
message = String.format(message, oldServerInfo, brokerIdPath);
throw new RuntimeException(message);
}
//
logger.info("Registering broker " + brokerIdPath + " succeeded with " + broker);
Expand Down

0 comments on commit 19af388

Please sign in to comment.