coolbeevip commented on issue #2345:
URL: https://github.com/apache/bookkeeper/issues/2345#issuecomment-632713378


   Why not use BookkeeperAdmin in ZKRegistrationManager to automatically 
initialize the cluster, Any explanation for that?
   
   ```
       @Override
       public String getClusterInstanceId() throws BookieException {
           String instanceId = null;
           try {
               if (zk.exists(ledgersRootPath, null) == null) {
                   try {
                       BookKeeperAdmin.initNewCluster(conf);
                   } catch (Exception e) {
                       log.error("BookKeeper metadata doesn't exist in 
zookeeper. "
                           + "Has the cluster been initialized? "
                           + "Try running bin/bookkeeper shell metaformat");
                       throw new KeeperException.NoNodeException("BookKeeper 
metadata");
                   }
               }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to