zhaijack opened a new issue #295: LocalBookKeeper failed to start
URL: https://github.com/apache/bookkeeper/issues/295
 
 
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - What did you do?
   
   Upgrade BK version to 4.5.0 in DL and run the tests.
   
   - What did you expect to see?
   
   The DL tests should pass.
   
   - What did you see instead?
   
   The DL tests fails because LocalBookKeeper can't startup.
   
   The cause is in following code: it doesn't set the correct zookeeper port.
   
       private void initializeZookeeper(int zkPort) throws IOException {
           LOG.info("Instantiate ZK Client");
           //initialize the zk client with values
           ZooKeeperClient zkc = null;
           try {
               zkc = ZooKeeperClient.newBuilder()
                       
.connectString(InetAddress.getLoopbackAddress().getHostAddress() + ":" + 
zkDefaultPort)
                       .sessionTimeoutMs(zkSessionTimeOut)
                       .build();
               zkc.create("/ledgers", new byte[0], Ids.OPEN_ACL_UNSAFE, 
CreateMode.PERSISTENT);
               zkc.create("/ledgers/available", new byte[0], 
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
               // No need to create an entry for each requested bookie anymore 
as the
               // BookieServers will register themselves with ZooKeeper on 
startup.
           } catch (KeeperException e) {
               LOG.error("Exception while creating znodes", e);
               throw new IOException("Error creating znodes : ", e);
           } catch (InterruptedException e) {
               LOG.error("Interrupted while creating znodes", e);
               throw new IOException("Error creating znodes : ", e);
           }
       }
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to